]> err.no Git - yubikey-personalization/commitdiff
when calling libusb_exit() clear usb_ctx and libusb_inited
authorKlas Lindfors <klas@yubico.com>
Fri, 21 Sep 2012 11:26:43 +0000 (13:26 +0200)
committerKlas Lindfors <klas@yubico.com>
Fri, 21 Sep 2012 11:26:43 +0000 (13:26 +0200)
ykcore/ykcore_libusb-1.0.c

index f5032ed9af60650810040cb43c79e84398f6d865..115606585c6c127e7410861556ebfa1dcdb0132c 100644 (file)
@@ -149,6 +149,8 @@ extern int _ykusb_stop(void)
 {
        if (libusb_inited == 1) {
                libusb_exit(usb_ctx);
+               usb_ctx = NULL;
+               libusb_inited = 0;
                return 1;
        }
        yk_errno = YK_EUSBERR;