Author: dgorbachev
Date: Wed Jan 6 02:28:23 2010
New Revision: 44972
URL:
http://svn.reactos.org/svn/reactos?rev=44972&view=rev
Log:
Check if MmHeapAlloc() failed.
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c [iso-8859-1] Wed Jan 6 02:28:23
2010
@@ -68,7 +68,7 @@
LoaderBlock.Flags |= MB_FLAGS_ACPI_TABLE;
/* Get BIOS memory map */
- RtlZeroMemory(BiosMemoryMap, sizeof(BIOS_MEMORY_MAP) * 32);
+ RtlZeroMemory(BiosMemoryMap, sizeof(BiosMemoryMap));
BiosMemoryMapEntryCount = PcMemGetMemoryMap(BiosMemoryMap,
sizeof(BiosMemoryMap) / sizeof(BIOS_MEMORY_MAP));
@@ -79,6 +79,14 @@
/* Set 'Configuration Data' value */
PartialResourceList =
MmHeapAlloc(sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize);
+
+ if (PartialResourceList == NULL)
+ {
+ DPRINTM(DPRINT_HWDETECT,
+ "Failed to allocate resource descriptor\n");
+ return;
+ }
+
memset(PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize);
PartialResourceList->Version = 0;
PartialResourceList->Revision = 0;