]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
MdeModulePkg: Fix misuses of AllocateCopyPool
[mirror_edk2.git] / MdeModulePkg / Library / BootMaintenanceManagerUiLib / BootMaintenanceManagerCustomizedUiSupport.c
index b25bc67c063c0d9629b6cc9eae674a6effbe41fe..6dd4fce1393850ef6ef4532f0270a53f41e29910 100644 (file)
@@ -435,9 +435,13 @@ BmmListThirdPartyDrivers (
 \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