diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2013-09-07 22:50:37 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2013-09-07 22:50:37 +0200 |
commit | de32a6140ab1457c6584da800708642d807b10b8 (patch) | |
tree | 823d643c3aa42ab74c36e235a85a87817ead64f0 | |
parent | 55bfee79a2c2f946a9e7f757670fae08fd8d4810 (diff) | |
download | 0xFFFF-de32a6140ab1457c6584da800708642d807b10b8.tar.bz2 |
operations: Fix crash when no usb device is detected
-rw-r--r-- | src/operations.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/operations.c b/src/operations.c index 88a7a59..2c28228 100644 --- a/src/operations.c +++ b/src/operations.c @@ -80,7 +80,8 @@ struct device_info * dev_detect(void) { } clean: - usb_close_device(usb); + if (usb) + usb_close_device(usb); free(dev); return NULL; |