]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
Correct DriverSample to produce the ConfigAccess protocol
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / ConfigRouting.c
index fe035969717bc10f337b873f180a2d3aa2ab79d1..2f5118e51268b58c661aa1454045429c9ad39027 100644 (file)
@@ -873,9 +873,9 @@ ParseIfrData (
       LengthString = StrLen (GuidStr);\r
       LengthString = LengthString + StrLen (NameStr) + 1;\r
       TempStr = AllocateZeroPool (LengthString * sizeof (CHAR16));\r
-      FreePool (GuidStr);\r
-      FreePool (NameStr);\r
     if (TempStr == NULL) {\r
+        FreePool (GuidStr);\r
+        FreePool (NameStr);\r
         FreePool (VarStoreName);\r
         Status = EFI_OUT_OF_RESOURCES;\r
         goto Done;\r
@@ -899,6 +899,8 @@ ParseIfrData (
       //\r
       // Free alllocated temp string.\r
       //\r
+      FreePool (GuidStr);\r
+      FreePool (NameStr);\r
       FreePool (TempStr);\r
       break;\r
 \r