firmware-utils/mksenaofw: fix possible memory leak

Add missing calls to `free` for variable `pmodel`.

Signed-off-by: Andrea Dalla Costa <andrea@dallacosta.me>
master
Andrea Dalla Costa 4 years ago committed by Jo-Philipp Wich
parent b886d3c8f3
commit 1775f690d5

@ -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);

Loading…
Cancel
Save