mirror of
https://github.com/RPCS3/hidapi.git
synced 2026-07-18 18:44:26 -04:00
libusb: Fix 'dev' memory leak on hid_init() failure.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
This commit is contained in:
+2
-2
@@ -790,11 +790,11 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path)
|
||||
int d = 0;
|
||||
int good_open = 0;
|
||||
|
||||
dev = new_hid_device();
|
||||
|
||||
if(hid_init() < 0)
|
||||
return NULL;
|
||||
|
||||
dev = new_hid_device();
|
||||
|
||||
libusb_get_device_list(usb_context, &devs);
|
||||
while ((usb_dev = devs[d++]) != NULL) {
|
||||
struct libusb_device_descriptor desc;
|
||||
|
||||
Reference in New Issue
Block a user