From de32a6140ab1457c6584da800708642d807b10b8 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sat, 7 Sep 2013 22:50:37 +0200 Subject: operations: Fix crash when no usb device is detected --- src/operations.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/operations.c') 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; -- cgit v1.2.3