darwin: fix SEGV on libusb_close after failed re-enumeration
authorNathan Hjelm <hjelmn@google.com>
Fri, 9 Jul 2021 04:43:28 +0000 (22:43 -0600)
committerNathan Hjelm <hjelmn@google.com>
Fri, 9 Jul 2021 04:45:07 +0000 (22:45 -0600)
commitced455398619b480e511d93f6c9664ae99978557
treee7057fadd38d05670e12f9557d529a051d49f383
parent5781c47cbd0eb5fbbe82905ec95ffbcd6a41f368
darwin: fix SEGV on libusb_close after failed re-enumeration

This commit fixes an issue that can occur if the user calls libusb_close after a failed attempt
of libusb_reset (re-enumerate). This can lead to an attempt to dereference dpriv->device which
was set to NULL during the re-enumeration.

Signed-off-by: Nathan Hjelm <hjelmn@google.com>
libusb/os/darwin_usb.c
libusb/version_nano.h