projects
/
openwrt
/
staging
/
noltari.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b886d3c
)
firmware-utils/mksenaofw: fix possible memory leak
author
Andrea Dalla Costa
<andrea@dallacosta.me>
Sat, 11 Jan 2020 22:55:25 +0000
(23:55 +0100)
committer
Jo-Philipp Wich
<jo@mein.io>
Tue, 14 Jan 2020 16:48:50 +0000
(17:48 +0100)
Add missing calls to `free` for variable `pmodel`.
Signed-off-by: Andrea Dalla Costa <andrea@dallacosta.me>
tools/firmware-utils/src/mksenaofw.c
patch
|
blob
|
history
diff --git
a/tools/firmware-utils/src/mksenaofw.c
b/tools/firmware-utils/src/mksenaofw.c
index b0fb7203c330b68992c63359c2eb8857f2953805..d9ccfbc1e0422634046d6066b913c30e54398428 100644
(file)
--- a/
tools/firmware-utils/src/mksenaofw.c
+++ b/
tools/firmware-utils/src/mksenaofw.c
@@
-316,10
+316,12
@@
int decode_image(const char *input_file_name, const char *output_file_name)
if (fread(pmodel, 1, cw_header.model_size, fp_input) !=
cw_header.model_size) {
fprintf(stderr, "Incorrect header size reading model name!!");
+ free(pmodel);
fclose(fp_input);
fclose(fp_output);
return -1;
}
+ free(pmodel);
} else {
fprintf(stderr, "Incorrect header size reading model name!!");
fclose(fp_input);