mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-06-14 04:16:15 -07:00
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:
@@ -1452,6 +1452,7 @@ InitFirmwareUpdate (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
//
|
//
|
||||||
// Error condition
|
// Error condition
|
||||||
|
FreePool(CapsuleImage);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -577,6 +577,7 @@ UpdateSystemFirmware (
|
|||||||
Status = VerifyFwStruct (ImageHdr);
|
Status = VerifyFwStruct (ImageHdr);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
DEBUG ((DEBUG_ERROR, " VerifyFwStruct failed with Status = 0x%x\n", Status));
|
DEBUG ((DEBUG_ERROR, " VerifyFwStruct failed with Status = 0x%x\n", Status));
|
||||||
|
FreePool(UpdatePartition);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -655,6 +656,7 @@ UpdateSingleComponent (
|
|||||||
DEBUG ((DEBUG_ERROR, "Updating component %4a failed with status = %r\n", (CHAR8 *)&CompName, Status));
|
DEBUG ((DEBUG_ERROR, "Updating component %4a failed with status = %r\n", (CHAR8 *)&CompName, Status));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FreePool(UpdatePartition);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user