summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
diff options
context:
space:
mode:
authorYao Jiewen <Jiewen.Yao@intel.com>2015-12-25 02:14:50 +0000
committerhwu1225 <hwu1225@Edk2>2015-12-25 02:14:50 +0000
commitd3fcd9cfb456b1ac4397644b2fb0e53967a50899 (patch)
treebbda7c63ed3d569426a3d8f08c45176385b22897 /ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
parent02990786fc540e4322733b5ab5b5a59f4d6c52b0 (diff)
downloadedk2-platforms-d3fcd9cfb456b1ac4397644b2fb0e53967a50899.tar.xz
ShellPkg: Fix memory leak in function 'ShellCommandCreateInitialMappingsAndPaths'.
(Sync patch r19527 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19539 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c')
-rw-r--r--ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
index 63886690d0..ceda7ab81e 100644
--- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
+++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
@@ -1261,6 +1261,9 @@ ShellCommandCreateInitialMappingsAndPaths(
; MapListNode = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
){
RemoveEntryList(&MapListNode->Link);
+ SHELL_FREE_NON_NULL(MapListNode->DevicePath);
+ SHELL_FREE_NON_NULL(MapListNode->MapName);
+ SHELL_FREE_NON_NULL(MapListNode->CurrentDirectoryPath);
FreePool(MapListNode);
} // for loop
}