FvbDev->LbaCache must be freed on error path before deallocating FvbDev.
Cc: Liming Gao <gaoliming@...>
Cc: Dandan Bi <dandan.bi@...>
Signed-off-by: Mike Maslenkin <mike.maslenkin@...>
---
MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c
index d81334ce24d1..9f5f40e5cd49 100644
--- a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c
+++ b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c
@@ -551,6 +551,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;
}
@@ -563,6 +564,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;
}
--
2.17.1