From Coverity: macos/hid.c: ```c hid_device * HID_API_EXPORT hid_open_path(const char *path) 1021{ 1. assign_zero: Assigning: dev = NULL. 1022 hid_device *dev = NULL; 1023 io_registry_entry_t entry = MACH_PORT_NULL; 1024 IOReturn ret = kIOReturnInvalid; 1025 char str[32]; 1026 1027 /* Set up the HID Manager if it hasn't been done */ 2. Condition hid_init() < 0, taking true branch. 1028 if (hid_init() < 0) { 3. Jumping to label return_error. 1029 goto return_error; 1030 } return_error: CID 1530048 (#1 of 1): Explicit null dereferenced (FORWARD_NULL) 4. var_deref_op: Dereferencing null pointer dev. 1088 if (dev->device_handle != NULL) 1089 CFRelease(dev->device_handle); ```
Activity
Fix libusb#547: Register global error and exit in case if hid_init fa…
Return from hid_open_path early in case if hid_init fails to avoid cr…