summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-14 08:37:06 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-14 09:04:50 +0200
commit3aedba66bd06de7e5db0fc38775fa20c29e40033 (patch)
tree47d7c93d6a2c8a57feaa193a83feebe64f952ae4
parent5ccd015371ba013f37e474b9e9f23b845fd17f43 (diff)
ipaccess: Fix a resource leak in case the stat is failing
Close the file when the stat is failing. Fixes: Coverity CID 1040711
-rw-r--r--openbsc/src/ipaccess/ipaccess-config.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c
index 75c37f0..e66771a 100644
--- a/openbsc/src/ipaccess/ipaccess-config.c
+++ b/openbsc/src/ipaccess/ipaccess-config.c
@@ -743,6 +743,7 @@ static void analyze_firmware(const char *filename)
/* verify the file */
if (fstat(fd, &stat) == -1) {
perror("Can not stat the file");
+ close(fd);
return;
}