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

Mike Maslenkin posted 2 patches 3 years, 5 months ago
There is a newer version of this series
[edk2-devel] [PATCH 1/2] MdeModulePkg/Core/Dxe: Fix memory leak issue in FwVol.c
Posted by Mike Maslenkin 3 years, 5 months ago
FwVolHeader must be deallocated on error path.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92453): https://edk2.groups.io/g/devel/message/92453
Mute This Topic: https://groups.io/mt/93047944/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-