]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
Source level security checked
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / Database.c
index fab12670d96175e7c76c53529f6eec77827d24a0..3d70207952918b21966ec741736f9c536cb16849 100644 (file)
@@ -877,13 +877,13 @@ InsertStringPackage (
 \r
 Error:\r
 \r
-  if (StringPackage->StringBlock != NULL) {\r
-    FreePool (StringPackage->StringBlock);\r
-  }\r
-  if (StringPackage->StringPkgHdr != NULL) {\r
-    FreePool (StringPackage->StringPkgHdr);\r
-  }\r
   if (StringPackage != NULL) {\r
+    if (StringPackage->StringBlock != NULL) {\r
+      FreePool (StringPackage->StringBlock);\r
+    }\r
+    if (StringPackage->StringPkgHdr != NULL) {\r
+      FreePool (StringPackage->StringPkgHdr);\r
+    }\r
     FreePool (StringPackage);\r
   }\r
   return Status;\r
@@ -1182,10 +1182,10 @@ Error:
   if (FontInfo != NULL) {\r
     FreePool (FontInfo);\r
   }\r
-  if (FontPackage->GlyphBlock != NULL) {\r
-    FreePool (FontPackage->GlyphBlock);\r
-  }\r
   if (FontPackage != NULL) {\r
+    if (FontPackage->GlyphBlock != NULL) {\r
+      FreePool (FontPackage->GlyphBlock);\r
+    }\r
     FreePool (FontPackage);\r
   }\r
   if (GlobalFont != NULL) {\r
@@ -1713,10 +1713,10 @@ InsertSimpleFontPackage (
 \r
 Error:\r
 \r
-  if (SimpleFontPackage->SimpleFontPkgHdr != NULL) {\r
-    FreePool (SimpleFontPackage->SimpleFontPkgHdr);\r
-  }\r
   if (SimpleFontPackage != NULL) {\r
+    if (SimpleFontPackage->SimpleFontPkgHdr != NULL) {\r
+      FreePool (SimpleFontPackage->SimpleFontPkgHdr);\r
+    }\r
     FreePool (SimpleFontPackage);\r
   }\r
   return Status;\r
@@ -2158,10 +2158,11 @@ InsertKeyboardLayoutPackage (
 \r
 Error:\r
 \r
-  if (KeyboardLayoutPackage->KeyboardPkg != NULL) {\r
-    FreePool (KeyboardLayoutPackage->KeyboardPkg);\r
-  }\r
+\r
   if (KeyboardLayoutPackage != NULL) {\r
+    if (KeyboardLayoutPackage->KeyboardPkg != NULL) {\r
+      FreePool (KeyboardLayoutPackage->KeyboardPkg);\r
+    }\r
     FreePool (KeyboardLayoutPackage);\r
   }\r
 \r