1
0
Fork 0

mkimage: Close the file when unable to get its size

There is a missing close() on the error path. Add it.

Reported-by: Coverity (CID: 138496)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
utp
Simon Glass 2016-03-16 07:45:37 -06:00 committed by Tom Rini
parent 4708a07c7c
commit b12a81c4cc
1 changed files with 1 additions and 0 deletions

View File

@ -107,6 +107,7 @@ int imagetool_get_filesize(struct image_tool_params *params, const char *fname)
if (fstat(fd, &sbuf) < 0) {
fprintf(stderr, "%s: Can't stat %s: %s\n",
params->cmdname, fname, strerror(errno));
close(fd);
return -1;
}
close(fd);