mirror of https://github.com/hak5/openwrt.git
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
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) !=
|
if (fread(pmodel, 1, cw_header.model_size, fp_input) !=
|
||||||
cw_header.model_size) {
|
cw_header.model_size) {
|
||||||
fprintf(stderr, "Incorrect header size reading model name!!");
|
fprintf(stderr, "Incorrect header size reading model name!!");
|
||||||
|
free(pmodel);
|
||||||
fclose(fp_input);
|
fclose(fp_input);
|
||||||
fclose(fp_output);
|
fclose(fp_output);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
free(pmodel);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Incorrect header size reading model name!!");
|
fprintf(stderr, "Incorrect header size reading model name!!");
|
||||||
fclose(fp_input);
|
fclose(fp_input);
|
||||||
|
|
Loading…
Reference in New Issue