From 5be090f0474473135a369b85e42442fba0fcbb6f Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Tue, 20 Oct 2015 22:03:51 +0200 Subject: [PATCH] ID:394 - close fp if isn't NULL and set it NULL afterwards in USB plugin Commit brings back check whether fp is or isn't NULL. If fp isn't NULL, close() is called and fp is set to NULL afterwards. --- src/plugins/usb/usb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/usb/usb.c b/src/plugins/usb/usb.c index 888d81d..0049400 100644 --- a/src/plugins/usb/usb.c +++ b/src/plugins/usb/usb.c @@ -147,7 +147,10 @@ scsiProbeNew(int *num_ami_devices, int *sg_nos) } *num_ami_devices = numdevfound; - fclose(fp); + if (fp != NULL) { + fclose(fp); + fp = NULL; + } return 0; }