Svace: Fixed MEMORY_LEAK.EX warning.

This commit is contained in:
ocbuild 2022-01-13 16:40:20 +03:00
parent fc244c6f0b
commit a7803f3888

View File

@ -561,6 +561,7 @@ ProduceFVBProtocolOnBuffer (
// //
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate); FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);
if (FvbDev->DevicePath == NULL) { if (FvbDev->DevicePath == NULL) {
FreePool (FvbDev->LbaCache);
FreePool (FvbDev); FreePool (FvbDev);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -572,6 +573,7 @@ ProduceFVBProtocolOnBuffer (
// //
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate); FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);
if (FvbDev->DevicePath == NULL) { if (FvbDev->DevicePath == NULL) {
FreePool (FvbDev->LbaCache);
FreePool (FvbDev); FreePool (FvbDev);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -714,6 +716,3 @@ CoreProcessFirmwareVolume (
} }
return Status; return Status;
} }