]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
ShellPkg: Fix memory leak in function 'ShellCommandCreateInitialMappingsAndPaths'.
[mirror_edk2.git] / ShellPkg / Library / UefiShellCommandLib / UefiShellCommandLib.c
index 63886690d07e50d48df9a407dde1b819da9cf12b..ceda7ab81e38c38ce9f34a39e79ac0445855ae0f 100644 (file)
@@ -1261,6 +1261,9 @@ ShellCommandCreateInitialMappingsAndPaths(
         ; MapListNode = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)\r
        ){\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
     } // for loop\r
   }\r