]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/GraphicsLib/Graphics.c
Remove SafeFreePool from MemoryAllocationLib as this API's name is misleading. Its...
[mirror_edk2.git] / MdeModulePkg / Library / GraphicsLib / Graphics.c
index 75aa91dc6c2f1a5e29a55f68428da166816ea409..bbf07fedddd113c80160a40e3ca8ee5f94e5e432 100644 (file)
@@ -467,7 +467,9 @@ EnableQuietBootEx (
       // Currently only support BMP format.\r
       //\r
       if (Format != EfiBadgingFormatBMP) {\r
-        SafeFreePool (ImageData);\r
+        if (ImageData != NULL) {\r
+          FreePool (ImageData);\r
+        }\r
         continue;\r
       }\r
     } else {\r
@@ -494,7 +496,9 @@ EnableQuietBootEx (
               &Width\r
               );\r
     if (EFI_ERROR (Status)) {\r
-      SafeFreePool (ImageData);\r
+      if (ImageData != NULL) {\r
+        FreePool (ImageData);\r
+      }\r
       if (Badging == NULL) {\r
         return Status;\r
       } else {\r
@@ -589,8 +593,12 @@ EnableQuietBootEx (
       }\r
     }\r
 \r
-    SafeFreePool (ImageData);\r
-    SafeFreePool (Blt);\r
+    if (ImageData != NULL) {\r
+      FreePool (ImageData);\r
+    }\r
+    if (Blt != NULL) {\r
+      FreePool (Blt);\r
+    }\r
 \r
     if (Badging == NULL) {\r
       break;\r
@@ -780,8 +788,8 @@ Print (
 \r
     Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
     if (Blt->Image.Bitmap == NULL) {\r
-      SafeFreePool (Blt);\r
-      SafeFreePool (Buffer);\r
+      FreePool (Blt);\r
+      FreePool (Buffer);\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
@@ -824,15 +832,23 @@ Print (
                           );\r
     }\r
 \r
-    SafeFreePool (RowInfoArray);\r
-    SafeFreePool (Blt->Image.Bitmap);\r
+    if (RowInfoArray != NULL) {\r
+      FreePool (RowInfoArray);\r
+    }\r
+    if (Blt->Image.Bitmap != NULL) {\r
+      FreePool (Blt->Image.Bitmap);\r
+    }\r
   } else {\r
     Status = EFI_UNSUPPORTED;\r
   }\r
 \r
 Error:\r
-  SafeFreePool (Blt);\r
-  SafeFreePool (FontInfo);\r
+  if (Blt != NULL) {\r
+    FreePool (Blt);\r
+  }\r
+  if (FontInfo != NULL) { \r
+    FreePool (FontInfo);\r
+  }\r
   FreePool (Buffer);\r
 \r
   if (EFI_ERROR (Status)) {\r