// Enlarge space here, because we will allocate pool now.\r
//\r
MemoryMapSize += EFI_PAGE_SIZE;\r
- MemoryMap = AllocatePool (MemoryMapSize);\r
- ASSERT (MemoryMap != NULL);\r
+ Status = gBS->AllocatePool (\r
+ EfiLoaderData,\r
+ MemoryMapSize,\r
+ (VOID **) &MemoryMap\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
\r
//\r
// Get System MemoryMap\r