public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Thomas Palmer <thomas.palmer@hpe.com>
To: edk2-devel@lists.01.org
Cc: eric.dong@intel.com, star.zeng@intel.com, garyli@hpe.com,
	joseph.shifflett@hpe.com, Thomas Palmer <thomas.palmer@hpe.com>
Subject: [PATCH 1/1] MdeModulePkg/DisplayEngineDxe: Fix small InitializeDisplayEngine leak
Date: Tue,  3 Jul 2018 11:46:01 -0500	[thread overview]
Message-ID: <1530636361-6450-1-git-send-email-thomas.palmer@hpe.com> (raw)

After calling RegisterHotKey, the allocated memory in NewString should
be freed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
---
 MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
index f2eac4d3fece..7390f954b67f 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
@@ -4221,11 +4221,13 @@ InitializeDisplayEngine (
     NewString         = HiiGetString (gHiiHandle, STRING_TOKEN (FUNCTION_TEN_STRING), NULL);
     ASSERT (NewString != NULL);
     FormBrowserEx2->RegisterHotKey (&HotKey, BROWSER_ACTION_SUBMIT, 0, NewString);
+    FreePool (NewString);
 
     HotKey.ScanCode   = SCAN_F9;
     NewString         = HiiGetString (gHiiHandle, STRING_TOKEN (FUNCTION_NINE_STRING), NULL);
     ASSERT (NewString != NULL);
     FormBrowserEx2->RegisterHotKey (&HotKey, BROWSER_ACTION_DEFAULT, EFI_HII_DEFAULT_CLASS_STANDARD, NewString);
+    FreePool (NewString);
   }
 
   return EFI_SUCCESS;
-- 
2.7.4



             reply	other threads:[~2018-07-03 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03 16:46 Thomas Palmer [this message]
2018-07-06  8:11 ` [PATCH 1/1] MdeModulePkg/DisplayEngineDxe: Fix small InitializeDisplayEngine leak Bi, Dandan
2018-07-06 11:18   ` Zeng, Star

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=1530636361-6450-1-git-send-email-thomas.palmer@hpe.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