From 09759d5836766fb3b886824cd669bc0dfc149d00 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Wed, 3 Oct 2012 23:52:16 +0100 Subject: [PATCH] Windows: Fix early abort in libusb_close * We're calling winusbx_close with SUB_API_NOTSET, so we should attempt to initialize it first. * Issue reported by Ramon Zambelli and Frank Hibbeln --- libusb/os/windows_usb.c | 2 ++ libusb/version_nano.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index fce4d43..332a368 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -2594,6 +2594,8 @@ static void winusbx_close(int sub_api, struct libusb_device_handle *dev_handle) HANDLE file_handle; int i; + if (sub_api == SUB_API_NOTSET) + sub_api = priv->sub_api; if (!WinUSBX[sub_api].initialized) return; diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 9c8b259..7cb278e 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10576 +#define LIBUSB_NANO 10577 -- 2.11.4.GIT