From c8cfd83ae8fc3ea581a78306bc7f15e3946e6e6b Mon Sep 17 00:00:00 2001 From: Yao Jiewen Date: Fri, 25 Dec 2015 01:41:38 +0000 Subject: [PATCH] ShellPkg: Fix memory leak in function 'ShellCommandCreateInitialMappingsAndPaths'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao Jiewen Reviewed-by: Qiu Shumin Reviewed-by: Ruiyu Ni git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19527 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 3 +++ 1 file changed, 3 insertions(+) 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 }