From a7803f3888b8f00620e4fe97c7de5b79159dbfd0 Mon Sep 17 00:00:00 2001 From: ocbuild Date: Thu, 13 Jan 2022 16:40:20 +0300 Subject: [PATCH] Svace: Fixed MEMORY_LEAK.EX warning. --- MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; } - - -