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>
This commit is contained in:
Andrea Dalla Costa 2020-01-12 00:05:55 +01:00 committed by Jo-Philipp Wich
parent 1775f690d5
commit 8057970d2a

View File

@ -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);