From 5b77132c8f46e74d0f882c272fbfcf5bda83b11a Mon Sep 17 00:00:00 2001 From: Yao Jiewen Date: Fri, 25 Dec 2015 01:33:53 +0000 Subject: [PATCH] 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 Reviewed-by: Qiu Shumin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19526 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c index c8d0e7887c..619cdd38a7 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); } -- 2.39.2