ShellPkg: Fix memory leak in function 'ShellCommandCreateInitialMappingsAndPaths'.

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/trunk/edk2@19527 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Yao Jiewen 2015-12-25 01:41:38 +00:00 committed by shenshushi
parent 5b77132c8f
commit c8cfd83ae8
1 changed files with 3 additions and 0 deletions

View File

@ -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
}