[PATCH 1/2] MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVol.c


Mike Maslenkin
 

FwVolHeader must be deallocated on error path.

Cc: Liming Gao <gaoliming@...>
Cc: Dandan Bi <dandan.bi@...>
Signed-off-by: Mike Maslenkin <mike.maslenkin@...>
---
MdeModulePkg/Core/Dxe/FwVol/FwVol.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c
index 153bfecafa77..0c1554ba4d63 100644
--- a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c
+++ b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c
@@ -659,6 +659,7 @@ NotifyFwVolBlock (
//
FvDevice = AllocateCopyPool (sizeof (FV_DEVICE), &mFvDevice);
if (FvDevice == NULL) {
+ CoreFreePool (FwVolHeader);
return;
}

--
2.17.1

Join {devel@edk2.groups.io to automatically receive all group messages.