diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c b/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c index 416ed3dca8..0362212c8b 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c @@ -174,6 +174,8 @@ InstallMemoryAttributesTable ( } MemoryMap = NEXT_MEMORY_DESCRIPTOR(MemoryMap, DescriptorSize); } + MemoryMap = MemoryMapStart; + FreePool (MemoryMap); Status = gBS->InstallConfigurationTable (&gEfiMemoryAttributesTableGuid, MemoryAttributesTable); ASSERT_EFI_ERROR (Status);