From 6a6471125bd0ce989d2801cb41c7629fa922f6f1 Mon Sep 17 00:00:00 2001 From: Carl Philipp Klemm Date: Tue, 7 May 2024 12:47:10 +0200 Subject: [PATCH] usb_shm: fix use of unalloced handle --- usbshm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usbshm.c b/usbshm.c index 22b5a61..b18ab7b 100644 --- a/usbshm.c +++ b/usbshm.c @@ -93,9 +93,6 @@ bool usbshm_is_open(struct usbshm* instance) int usbshm_open(struct usbshm* instance, int vendorID, int productID, const unsigned char* serial) { - if(instance->handle) - return USBSHM_ERROR_ALLREADY_CONNECTED; - int ret = usbshm_init(instance); if(ret < 0) return ret; @@ -104,7 +101,7 @@ int usbshm_open(struct usbshm* instance, int vendorID, int productID, const unsi libusb_device** list; int count = libusb_get_device_list(context, &list); int errorCode = 0; - if( count > 0) + if(count > 0) { struct libusb_device_descriptor desc = {0}; for(int i = 0; i < count; ++i)