From d0ff29562959562559631147e20b4b63a38a67b7 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 --- src/mktitanimg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mktitanimg.c b/src/mktitanimg.c index cca4a0e..120d08f 100644 --- a/src/mktitanimg.c +++ b/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