cbfstool: Fix possible memory leak

Handle the possible memory leak scenario.

Foundby=klocwork
BUG=NONE
TEST=Boot to OS on Nivviks

Change-Id: I01c4643d1e671d9bd9971ac6db8031634fffd61e
Signed-off-by: Shaik Shahina <shahina.shaik@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69220
Reviewed-by: Shahina Shaik <shahina.shaik@intel.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
Shaik Shahina
2022-11-05 01:07:06 +05:30
committed by Martin Roth
parent 5c1dcd57ee
commit 425413c35f
2 changed files with 8 additions and 3 deletions

View File

@@ -770,8 +770,8 @@ static int cbfs_add_master_header(void)
*/
if (param.topswap_size) {
if (update_master_header_loc_topswap(&image, h_loc,
header_offset))
return 1;
header_offset))
goto done;
}
ret = maybe_update_metadata_hash(&image);