public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Star Zeng <star.zeng@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Yonghong Zhu <yonghong.zhu@intel.com>
Subject: [PATCH 2/6] MdeModulePkg CapsuleApp: Fix memory leak in DumpFmpImage()
Date: Fri, 13 Jul 2018 17:08:39 +0800	[thread overview]
Message-ID: <1531472923-253528-3-git-send-email-star.zeng@intel.com> (raw)
In-Reply-To: <1531472923-253528-1-git-send-email-star.zeng@intel.com>

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



  parent reply	other threads:[~2018-07-13  9:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13  9:08 [PATCH 0/6] CapsuleApp: Some enhancements Star Zeng
2018-07-13  9:08 ` [PATCH 1/6] MdeModulePkg CapsuleApp: Check Arg count for -P GET option Star Zeng
2018-07-13  9:08 ` Star Zeng [this message]
2018-07-13  9:08 ` [PATCH 3/6] MdeModulePkg CapsuleApp: Do not parse bits in CapsuleFlags of ESRT Star Zeng
2018-07-13  9:08 ` [PATCH 4/6] MdeModulePkg CapsuleApp: Show clear message when option is unrecognized Star Zeng
2018-07-13  9:08 ` [PATCH 5/6] MdeModulePkg CapsuleApp: Check capsule header before using its Flags Star Zeng
2018-07-13  9:08 ` [PATCH 6/6] MdeModulePkg CapsuleApp: Use EFI_UNSUPPORTED for incorrect Argc case Star Zeng
2018-07-23  0:59 ` [PATCH 0/6] CapsuleApp: Some enhancements Yao, Jiewen
2018-07-27  1:33 ` Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1531472923-253528-3-git-send-email-star.zeng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox