projects
/
openwrt
/
staging
/
dangole.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
22b07ff
)
firmware-utils/dgfirmare: fix possible resource leak
author
Andrea Dalla Costa
<andrea@dallacosta.me>
Sat, 11 Jan 2020 21:27:39 +0000
(22:27 +0100)
committer
Jo-Philipp Wich
<jo@mein.io>
Tue, 14 Jan 2020 16:48:50 +0000
(17:48 +0100)
Add missing calls to `fclose` in functions `write_img`, `write_rootfs`
and `write_kernel`.
The not-closed files could lead to resource leaks.
Signed-off-by: Andrea Dalla Costa <andrea@dallacosta.me>
tools/firmware-utils/src/dgfirmware.c
patch
|
blob
|
history
diff --git
a/tools/firmware-utils/src/dgfirmware.c
b/tools/firmware-utils/src/dgfirmware.c
index e3257f1077903ed47c7be58f29d7ba0b5b6e754c..3ec4712ec9351328bcaf104ce0b6336f44a599bd 100644
(file)
--- a/
tools/firmware-utils/src/dgfirmware.c
+++ b/
tools/firmware-utils/src/dgfirmware.c
@@
-86,6
+86,8
@@
void write_img(unsigned char* img, const char *fname)
fclose(fp);
exit(-1);
}
+
+ fclose(fp);
}
@@
-104,6
+106,8
@@
void write_rootfs(unsigned char* img, const char *fname)
fclose(fp);
exit(-1);
}
+
+ fclose(fp);
}
@@
-122,6
+126,8
@@
void write_kernel(unsigned char* img, const char *fname)
fclose(fp);
exit(-1);
}
+
+ fclose(fp);
}