core: Do not attempt to destroy a default context that doesn't exist
authorChris Dickens <christopher.a.dickens@gmail.com>
Mon, 13 Jan 2020 23:05:00 +0000 (15:05 -0800)
committerChris Dickens <christopher.a.dickens@gmail.com>
Mon, 13 Jan 2020 23:05:00 +0000 (15:05 -0800)
commita5624b22267ec0e146825d3fe94d9e4b2f5ae503
tree5b6cc661ea91ee0156fc948dde0ae9e3ef9702e6
parentdbd4991a2478ae57e39347bf8610e636554e4c1f
core: Do not attempt to destroy a default context that doesn't exist

Calling libusb_exit(NULL) when a successful call to libusb_init(NULL)
has not been made results in a segmentation violation. This is
definitely a user error, but we can easily guard against it.

Closes #511

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/core.c
libusb/version_nano.h