Add missing libusb_exit on an error condition
authorgudenau <gudenau@users.noreply.github.com>
Wed, 20 Jun 2018 01:12:52 +0000 (20:12 -0500)
committerNathan Hjelm <hjelmn@lanl.gov>
Wed, 5 Dec 2018 17:09:12 +0000 (10:09 -0700)
Closes #448

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
examples/listdevs.c
libusb/version_nano.h

index 3328910..b5b027c 100644 (file)
@@ -60,8 +60,10 @@ int main(void)
                return r;
 
        cnt = libusb_get_device_list(NULL, &devs);
-       if (cnt < 0)
+       if (cnt < 0){
+               libusb_exit(NULL);
                return (int) cnt;
+       }
 
        print_devs(devs);
        libusb_free_device_list(devs, 1);
index 08264b3..8c03606 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11321
+#define LIBUSB_NANO 11322