summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorYao Jiewen <Jiewen.Yao@intel.com>2015-12-25 01:33:53 +0000
committershenshushi <shenshushi@Edk2>2015-12-25 01:33:53 +0000
commit5b77132c8f46e74d0f882c272fbfcf5bda83b11a (patch)
tree28f61c342b9c6cf16c9305cf2516f4294abecbec /ShellPkg
parent4afbcc112b666dbebeca54d11bd5f84b814b92ed (diff)
downloadedk2-5b77132c8f46e74d0f882c272fbfcf5bda83b11a.tar.gz
ShellPkg: Fix memory leak in function'ShellCommandRunHelp'.
When run help command Shell may have memory leak. This patch fix this bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19526 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c
index c8d0e7887..619cdd38a 100644
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c
+++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c
@@ -311,6 +311,7 @@ ShellCommandRunHelp (
ShellStatus = SHELL_SUCCESS;
CommandToGetHelpOn = NULL;
SectionToGetHelpOn = NULL;
+ SortedCommandList = NULL;
Found = FALSE;
//
@@ -471,6 +472,7 @@ ShellCommandRunHelp (
if (SectionToGetHelpOn != NULL) {
FreePool(SectionToGetHelpOn);
}
+ SHELL_FREE_NON_NULL(SortedCommandList);
return (ShellStatus);
}