){\r
if (StringNoCaseCompare(&MapListNode->MapName, &Mapping) == 0) {\r
RemoveEntryList(&MapListNode->Link);\r
+ SHELL_FREE_NON_NULL(MapListNode->DevicePath);\r
+ SHELL_FREE_NON_NULL(MapListNode->MapName);\r
+ SHELL_FREE_NON_NULL(MapListNode->CurrentDirectoryPath);\r
FreePool(MapListNode);\r
return (EFI_SUCCESS);\r
}\r
}\r
\r
if (MapListItem == NULL) {\r
+ FreePool (DirectoryName);\r
+ SHELL_FREE_NON_NULL(MapName);\r
return (EFI_NOT_FOUND);\r
}\r
\r
ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL));\r
MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, DirectoryName+StrLen(MapName), 0);\r
}\r
+ FreePool (MapName);\r
} else {\r
ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL));\r
MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, DirectoryName, 0);\r
// cant have a mapping in the directory...\r
//\r
if (StrStr(DirectoryName, L":") != NULL) {\r
+ FreePool (DirectoryName);\r
return (EFI_INVALID_PARAMETER);\r
}\r
//\r
//\r
MapListItem = ShellCommandFindMapItem(FileSystem);\r
if (MapListItem == NULL) {\r
+ FreePool (DirectoryName);\r
return (EFI_INVALID_PARAMETER);\r
}\r
// gShellCurDir = MapListItem;\r
}\r
}\r
}\r
+ FreePool (DirectoryName);\r
//\r
// if updated the current directory then update the environment variable\r
//\r