]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
MdeModulePkg: Fix misuses of AllocateCopyPool
[mirror_edk2.git] / MdeModulePkg / Application / UiApp / FrontPageCustomizedUiSupport.c
index 1505ef931916a1092d26626dc531d2471377f31f..17fc3db507d08d80957a7f617b8632145de86d16 100644 (file)
@@ -639,9 +639,13 @@ UiListThirdPartyDrivers (
 \r
     Count++;\r
     if (Count >= CurrentSize) {\r
-      DriverListPtr = AllocateCopyPool ((Count + UI_HII_DRIVER_LIST_SIZE) * sizeof (UI_HII_DRIVER_INSTANCE), gHiiDriverList);\r
+      DriverListPtr = ReallocatePool (\r
+                        CurrentSize * sizeof (UI_HII_DRIVER_INSTANCE),\r
+                        (Count + UI_HII_DRIVER_LIST_SIZE)\r
+                          * sizeof (UI_HII_DRIVER_INSTANCE),\r
+                        gHiiDriverList\r
+                        );\r
       ASSERT (DriverListPtr != NULL);\r
-      FreePool (gHiiDriverList);\r
       gHiiDriverList = DriverListPtr;\r
       CurrentSize += UI_HII_DRIVER_LIST_SIZE;\r
     }\r