fix: [Common] Fix Coverity issues
Fixed resource leak. Free resource prior to return (CWE 404) Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
This commit is contained in:
parent
971048cfc1
commit
74e12f7708
|
@ -1452,6 +1452,7 @@ InitFirmwareUpdate (
|
|||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// Error condition
|
||||
FreePool(CapsuleImage);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
|
|
@ -577,6 +577,7 @@ UpdateSystemFirmware (
|
|||
Status = VerifyFwStruct (ImageHdr);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, " VerifyFwStruct failed with Status = 0x%x\n", Status));
|
||||
FreePool(UpdatePartition);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@ -655,6 +656,7 @@ UpdateSingleComponent (
|
|||
DEBUG ((DEBUG_ERROR, "Updating component %4a failed with status = %r\n", (CHAR8 *)&CompName, Status));
|
||||
}
|
||||
|
||||
FreePool(UpdatePartition);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue