Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33992 )
Change subject: util/cbfstool: Close file on error ......................................................................
util/cbfstool: Close file on error
Prevents a resource leak.
Change-Id: I032227228c8e37e989960ad6292ded39b81835a9 Signed-off-by: Jacob Garber jgarber1@ualberta.ca Found-by: Coverity CID 1383919 Reviewed-on: https://review.coreboot.org/c/coreboot/+/33992 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- M util/cbfstool/partitioned_file.c 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/util/cbfstool/partitioned_file.c b/util/cbfstool/partitioned_file.c index 9abd32a..a2d9ddf 100644 --- a/util/cbfstool/partitioned_file.c +++ b/util/cbfstool/partitioned_file.c @@ -197,8 +197,10 @@ 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",