]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/UefiIfrParser.c
Remove SafeFreePool from MemoryAllocationLib as this API's name is misleading. Its...
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / FrameworkHiiToUefiHiiThunk / UefiIfrParser.c
index 8870128ad2cc976b04cf184b09c924f609f89d49..8b130af45fdbdceb942615764b18e8493738e0a7 100644 (file)
@@ -386,7 +386,9 @@ DestroyExpression (
     OpCode = EXPRESSION_OPCODE_FROM_LINK (Link);\r
     RemoveEntryList (&OpCode->Link);\r
 \r
-    SafeFreePool (OpCode->ValueList);\r
+    if (OpCode->ValueList != NULL) {\r
+      FreePool (OpCode->ValueList);\r
+    }\r
   }\r
 \r
   //\r
@@ -416,25 +418,25 @@ DestroyStorage (
     return;\r
   }\r
 \r
-  SafeFreePool (Storage->Name);\r
-  SafeFreePool (Storage->Buffer);\r
-  SafeFreePool (Storage->EditBuffer);\r
+  FreePool (Storage->Name);\r
+  FreePool (Storage->Buffer);\r
+  FreePool (Storage->EditBuffer);\r
 \r
   while (!IsListEmpty (&Storage->NameValueListHead)) {\r
     Link = GetFirstNode (&Storage->NameValueListHead);\r
     NameValueNode = NAME_VALUE_NODE_FROM_LINK (Link);\r
     RemoveEntryList (&NameValueNode->Link);\r
 \r
-    SafeFreePool (NameValueNode->Name);\r
-    SafeFreePool (NameValueNode->Value);\r
-    SafeFreePool (NameValueNode->EditValue);\r
-    SafeFreePool (NameValueNode);\r
+    FreePool (NameValueNode->Name);\r
+    FreePool (NameValueNode->Value);\r
+    FreePool (NameValueNode->EditValue);\r
+    FreePool (NameValueNode);\r
   }\r
 \r
-  SafeFreePool (Storage->ConfigHdr);\r
-  SafeFreePool (Storage->ConfigRequest);\r
+  FreePool (Storage->ConfigHdr);\r
+  FreePool (Storage->ConfigRequest);\r
 \r
-  gBS->FreePool (Storage);\r
+  FreePool (Storage);\r
 }\r
 \r
 \r
@@ -500,11 +502,16 @@ DestroyStatement (
     DestroyExpression (Expression);\r
   }\r
 \r
-  SafeFreePool (Statement->VariableName);\r
-  SafeFreePool (Statement->BlockName);\r
+  if (Statement->VariableName != NULL) {\r
+    FreePool (Statement->VariableName);\r
+  }\r
+  if (Statement->BlockName != NULL) {\r
+    FreePool (Statement->BlockName);\r
+  }\r
 }\r
 \r
 \r
+\r
 /**\r
   Free resources of a Form\r
 \r
@@ -572,7 +579,7 @@ DestroyFormSet (
   //\r
   // Free IFR binary buffer\r
   //\r
-  SafeFreePool (FormSet->IfrBinaryData);\r
+  FreePool (FormSet->IfrBinaryData);\r
 \r
   //\r
   // Free FormSet Storage\r
@@ -613,10 +620,14 @@ DestroyFormSet (
     }\r
   }\r
 \r
-  SafeFreePool (FormSet->StatementBuffer);\r
-  SafeFreePool (FormSet->ExpressionBuffer);\r
+  if (FormSet->StatementBuffer != NULL) {\r
+    FreePool (FormSet->StatementBuffer);\r
+  }\r
+  if (FormSet->ExpressionBuffer != NULL) {\r
+    FreePool (FormSet->ExpressionBuffer);\r
+  }\r
 \r
-  SafeFreePool (FormSet);\r
+  FreePool (FormSet);\r
 }\r
 \r
 \r