only clear it when the buffer is valid

svn path=/trunk/; revision=31179
This commit is contained in:
Christoph von Wittich 2007-12-12 09:17:59 +00:00
parent aa81962d7e
commit 1468b24275

View file

@ -29,13 +29,14 @@ FldrpHwHeapAlloc(IN ULONG Size)
/* Return a block of memory from the ARC Hardware Heap */
Buffer = &reactos_arc_hardware_data[FldrpHwHeapLocation];
/* Clear it */
RtlZeroMemory(Buffer, Size);
/* Increment the heap location */
FldrpHwHeapLocation += Size;
if (FldrpHwHeapLocation > HW_MAX_ARC_HEAP_SIZE) Buffer = NULL;
/* Clear it */
if (Buffer)
RtlZeroMemory(Buffer, Size);
/* Return the buffer */
return Buffer;
}