MdeModulePkg CapsuleApp: Fix memory leak in DumpFmpImage()
authorStar Zeng <star.zeng@intel.com>
Fri, 13 Jul 2018 07:04:16 +0000 (15:04 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 23 Jul 2018 01:17:24 +0000 (09:17 +0800)
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>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Application/CapsuleApp/CapsuleDump.c

index 6c13209..c0197dd 100644 (file)
@@ -953,5 +953,7 @@ DumpFmpImage (
   Status = WriteFileFromBuffer(ImageName, ImageSize, Image);\r
   Print(L"CapsuleApp: Dump %g ImageIndex (0x%x) to %s %r\n", ImageTypeId, ImageIndex, ImageName, Status);\r
 \r
+  FreePool (Image);\r
+\r
   return ;\r
 }\r