summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2013-09-07 22:50:37 +0200
committerPali Rohár <pali.rohar@gmail.com>2013-09-07 22:50:37 +0200
commitde32a6140ab1457c6584da800708642d807b10b8 (patch)
tree823d643c3aa42ab74c36e235a85a87817ead64f0
parent55bfee79a2c2f946a9e7f757670fae08fd8d4810 (diff)
download0xFFFF-de32a6140ab1457c6584da800708642d807b10b8.tar.bz2
operations: Fix crash when no usb device is detected
-rw-r--r--src/operations.c3
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;