diff options
author | Andrea Dalla Costa <andrea@dallacosta.me> | 2020-01-11 23:55:25 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-01-14 17:48:50 +0100 |
commit | 1775f690d5e3dfc2f70c0e416c91371c848b9f25 (patch) | |
tree | 0837543fbaa29faf0bae2f4db65746bc09d8c79a | |
parent | b886d3c8f3d852a5d5bfcb41f439a808d9aa2d58 (diff) | |
download | upstream-1775f690d5e3dfc2f70c0e416c91371c848b9f25.tar.gz upstream-1775f690d5e3dfc2f70c0e416c91371c848b9f25.tar.bz2 upstream-1775f690d5e3dfc2f70c0e416c91371c848b9f25.zip |
firmware-utils/mksenaofw: fix possible memory leak
Add missing calls to `free` for variable `pmodel`.
Signed-off-by: Andrea Dalla Costa <andrea@dallacosta.me>
-rw-r--r-- | tools/firmware-utils/src/mksenaofw.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/firmware-utils/src/mksenaofw.c b/tools/firmware-utils/src/mksenaofw.c index b0fb7203c3..d9ccfbc1e0 100644 --- 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); |