diff options
author | Andrea Dalla Costa <andrea@dallacosta.me> | 2020-01-12 00:05:55 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-01-14 17:48:50 +0100 |
commit | 8057970d2a32b8f5c9804855b138eceeb757b98e (patch) | |
tree | f93783a16fd1c81ac40dd1662d01bef768ef8958 /tools | |
parent | 1775f690d5e3dfc2f70c0e416c91371c848b9f25 (diff) | |
download | upstream-8057970d2a32b8f5c9804855b138eceeb757b98e.tar.gz upstream-8057970d2a32b8f5c9804855b138eceeb757b98e.tar.bz2 upstream-8057970d2a32b8f5c9804855b138eceeb757b98e.zip |
firmware-utils/mktitanimg: fix possible resource leak
Add missing call to `fclose` for file pointer `nsp_image`.
Signed-off-by: Andrea Dalla Costa <andrea@dallacosta.me>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/firmware-utils/src/mktitanimg.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/firmware-utils/src/mktitanimg.c b/tools/firmware-utils/src/mktitanimg.c index cca4a0ebae..120d08f0c4 100644 --- a/tools/firmware-utils/src/mktitanimg.c +++ b/tools/firmware-utils/src/mktitanimg.c @@ -225,6 +225,7 @@ int main(int argc, char* argv[], char* env[]) if(fwrite((void*)buf,1,padding,nsp_image)!=padding) { printf("ERROR: can't write to %s.\n", filen_out); free(buf); + fclose(nsp_image); return -1; } free(buf); |