diff --git a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c index 95174c1e46..87376ba6fb 100644 --- a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c +++ b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c @@ -561,6 +561,7 @@ ProduceFVBProtocolOnBuffer ( // FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate); if (FvbDev->DevicePath == NULL) { + FreePool (FvbDev->LbaCache); FreePool (FvbDev); return EFI_OUT_OF_RESOURCES; } @@ -572,6 +573,7 @@ ProduceFVBProtocolOnBuffer ( // FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate); if (FvbDev->DevicePath == NULL) { + FreePool (FvbDev->LbaCache); FreePool (FvbDev); return EFI_OUT_OF_RESOURCES; } @@ -714,6 +716,3 @@ CoreProcessFirmwareVolume ( } return Status; } - - -