summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/imagetool.c1
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);