diff options
author | Sean McBride <sean@rogue-research.com> | 2021-08-20 15:57:52 -0400 |
---|---|---|
committer | Tormod Volden <debian.tormod@gmail.com> | 2021-10-30 15:23:45 +0200 |
commit | edd1a4bfe4b037e67b65e4538fd880123fb004f7 (patch) | |
tree | fd0499d3195253ebe6fabecf9ffad3629c1ef455 | |
parent | 35b23a047e333ce361cea3315a15301286d89612 (diff) | |
download | libusb-edd1a4bfe4b037e67b65e4538fd880123fb004f7.tar.gz |
darwin: After last CFRelease of struct field, set it to NULL
Other code checks this field for being NULL or not, so NULLing it upon
last release seems the right thing to do. I noticed this during code
review, I never actually reproduced any problem.
Closes #981
-rw-r--r-- | libusb/os/darwin_usb.c | 1 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c index 485eb43..a2da0cf 100644 --- a/libusb/os/darwin_usb.c +++ b/libusb/os/darwin_usb.c @@ -1570,6 +1570,7 @@ static int darwin_release_interface(struct libusb_device_handle *dev_handle, uin if (cInterface->cfSource) { CFRunLoopRemoveSource (libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode); CFRelease (cInterface->cfSource); + cInterface->cfSource = NULL; } kresult = (*(cInterface->interface))->USBInterfaceClose(cInterface->interface); diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 7bbbe39..b82862d 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11662 +#define LIBUSB_NANO 11663 |