diff options
author | Simon Glass <sjg@chromium.org> | 2016-03-16 07:45:37 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-03-22 12:16:19 -0400 |
commit | b12a81c4ccfdfac1eabefdaeba2a19fab3102716 (patch) | |
tree | a8c821297ec4c2ae464386f7c562c7a10501caf5 /tools | |
parent | 4708a07c7cfa754658d06283a399ddb175278de7 (diff) |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/imagetool.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/imagetool.c b/tools/imagetool.c index 351211cd538..916ab964d55 100644 --- a/tools/imagetool.c +++ b/tools/imagetool.c @@ -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); |