[edk2] [PATCH 2/6] MdeModulePkg CapsuleApp: Fix memory leak in DumpFmpImage()

Star Zeng posted 6 patches 7 years, 7 months ago
[edk2] [PATCH 2/6] MdeModulePkg CapsuleApp: Fix memory leak in DumpFmpImage()
Posted by Star Zeng 7 years, 7 months ago
Image buffer should be freed after using.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Application/CapsuleApp/CapsuleDump.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
index 6c1320942bf4..c0197dd640e4 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
@@ -953,5 +953,7 @@ DumpFmpImage (
   Status = WriteFileFromBuffer(ImageName, ImageSize, Image);
   Print(L"CapsuleApp: Dump %g ImageIndex (0x%x) to %s %r\n", ImageTypeId, ImageIndex, ImageName, Status);
 
+  FreePool (Image);
+
   return ;
 }
-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel