summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/amdfwtool/amdfwtool.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c
index 37dbcd093f..e8ac0b1ae9 100644
--- a/util/amdfwtool/amdfwtool.c
+++ b/util/amdfwtool/amdfwtool.c
@@ -566,11 +566,13 @@ static ssize_t copy_blob(void *dest, const char *src_file, size_t room)
if (fstat(fd, &fd_stat)) {
printf("fstat error: %s\n", strerror(errno));
+ close(fd);
return -2;
}
if (fd_stat.st_size > room) {
printf("Error: %s will not fit. Exiting.\n", src_file);
+ close(fd);
return -3;
}