From: Andrea Dalla Costa Date: Sat, 11 Jan 2020 23:05:55 +0000 (+0100) Subject: firmware-utils/mktitanimg: fix possible resource leak X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8057970d2a32b8f5c9804855b138eceeb757b98e;p=openwrt%2Fstaging%2Fwigyori.git firmware-utils/mktitanimg: fix possible resource leak Add missing call to `fclose` for file pointer `nsp_image`. Signed-off-by: Andrea Dalla Costa --- 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);