summaryrefslogtreecommitdiff
path: root/util/cbfstool/partitioned_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool/partitioned_file.c')
-rw-r--r--util/cbfstool/partitioned_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/cbfstool/partitioned_file.c b/util/cbfstool/partitioned_file.c
index 9abd32aab6..a2d9ddfee2 100644
--- a/util/cbfstool/partitioned_file.c
+++ b/util/cbfstool/partitioned_file.c
@@ -197,8 +197,10 @@ partitioned_file_t *partitioned_file_reopen(const char *filename,
const struct fmap_area *fmap_fmap_entry =
fmap_find_area(file->fmap, SECTION_NAME_FMAP);
- if (!fmap_fmap_entry)
+ if (!fmap_fmap_entry) {
+ partitioned_file_close(file);
return NULL;
+ }
if ((long)fmap_fmap_entry->offset != fmap_region_offset) {
ERROR("FMAP's '%s' section doesn't point back to FMAP start (did something corrupt this file?)\n",