]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/ConsoleWrappers.c
ShellPkg: Per UEFI Shell 2.2 SPEC to make Shell supports 'NoNesting'.
[mirror_edk2.git] / ShellPkg / Application / Shell / ConsoleWrappers.c
index 04a7513a3346fabb272c70c58c74bfe184e7f190..46af141eba99c9de3827f44a1f0689ee7327b417 100644 (file)
@@ -484,7 +484,8 @@ CreateSimpleTextOutOnFile(
     *HandleLocation = ProtocolToReturn->TheHandle;\r
     return ((EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)ProtocolToReturn);\r
   } else {\r
-    FreePool(ProtocolToReturn);\r
+    SHELL_FREE_NON_NULL(ProtocolToReturn->SimpleTextOut.Mode);\r
+    SHELL_FREE_NON_NULL(ProtocolToReturn);\r
     return (NULL);\r
   }\r
 }\r
@@ -511,6 +512,7 @@ CloseSimpleTextOutOnFile(
     ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->TheHandle, \r
     &gEfiSimpleTextOutProtocolGuid, \r
     &(((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->SimpleTextOut));\r
+  FreePool(SimpleTextOut->Mode);\r
   FreePool(SimpleTextOut);\r
   return (Status);\r
 }\r