]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
Remove SafeFreePool from MemoryAllocationLib as this API's name is misleading. Its...
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / BootMaint / ConsoleOption.c
index 635dc34173c04033108293865ce0971c98478bbc..b9ffa056dacf372ab4aa06ff7811809e8588214a 100644 (file)
@@ -419,7 +419,7 @@ LocateSerialIo (
     if (CompareMem (&Acpi->HID, &Match, sizeof (UINT32)) == 0) {\r
       NewMenuEntry = BOpt_CreateMenuEntry (BM_TERMINAL_CONTEXT_SELECT);\r
       if (NewMenuEntry == NULL) {\r
-        SafeFreePool (Handles);\r
+        FreePool (Handles);\r
         return EFI_OUT_OF_RESOURCES;\r
       }\r
 \r
@@ -472,7 +472,9 @@ LocateSerialIo (
       TerminalMenu.MenuNumber++;\r
     }\r
   }\r
-  SafeFreePool (Handles);\r
+  if (Handles != NULL) {\r
+    FreePool (Handles);\r
+  }\r
 \r
   //\r
   // Get L"ConOut", L"ConIn" and L"ErrOut" from the Var\r
@@ -515,7 +517,9 @@ LocateSerialIo (
                         NewTerminalContext->DevicePath,\r
                         (EFI_DEVICE_PATH_PROTOCOL *) &Vendor\r
                         );\r
-      SafeFreePool (NewMenuEntry->HelpString);\r
+      if (NewMenuEntry->HelpString != NULL) {\r
+        FreePool (NewMenuEntry->HelpString);\r
+      }\r
       //\r
       // NewMenuEntry->HelpString = DevicePathToStr (NewDevicePath);\r
       // NewMenuEntry->DisplayString = NewMenuEntry->HelpString;\r
@@ -999,6 +1003,6 @@ GetConsoleOutMode (
         }\r
       }\r
     }\r
+    FreePool (ModeInfo);\r
   }\r
-  SafeFreePool (ModeInfo);\r
 }\r