mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-31 16:35:44 +00:00
firmware-utils/mksenaofw: fix possible memory leak
Add missing calls to `free` for variable `pmodel`. Signed-off-by: Andrea Dalla Costa <andrea@dallacosta.me>
This commit is contained in:
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…
x
Reference in New Issue
Block a user