From 8057970d2a32b8f5c9804855b138eceeb757b98e Mon Sep 17 00:00:00 2001 From: Andrea Dalla Costa Date: Sun, 12 Jan 2020 00:05:55 +0100 Subject: [PATCH] firmware-utils/mktitanimg: fix possible resource leak Add missing call to `fclose` for file pointer `nsp_image`. Signed-off-by: Andrea Dalla Costa --- tools/firmware-utils/src/mktitanimg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/firmware-utils/src/mktitanimg.c b/tools/firmware-utils/src/mktitanimg.c index cca4a0ebaece..120d08f0c4fb 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); -- 2.30.2