Browse Source

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>
master
Andrea Dalla Costa 3 years ago
committed by Jo-Philipp Wich
parent
commit
8057970d2a
  1. 1
      tools/firmware-utils/src/mktitanimg.c

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

Loading…
Cancel
Save