mirror of
https://github.com/reactos/reactos.git
synced 2024-07-31 08:39:05 +00:00
only clear it when the buffer is valid
svn path=/trunk/; revision=31179
This commit is contained in:
parent
aa81962d7e
commit
1468b24275
|
@ -29,13 +29,14 @@ FldrpHwHeapAlloc(IN ULONG Size)
|
||||||
/* Return a block of memory from the ARC Hardware Heap */
|
/* Return a block of memory from the ARC Hardware Heap */
|
||||||
Buffer = &reactos_arc_hardware_data[FldrpHwHeapLocation];
|
Buffer = &reactos_arc_hardware_data[FldrpHwHeapLocation];
|
||||||
|
|
||||||
/* Clear it */
|
|
||||||
RtlZeroMemory(Buffer, Size);
|
|
||||||
|
|
||||||
/* Increment the heap location */
|
/* Increment the heap location */
|
||||||
FldrpHwHeapLocation += Size;
|
FldrpHwHeapLocation += Size;
|
||||||
if (FldrpHwHeapLocation > HW_MAX_ARC_HEAP_SIZE) Buffer = NULL;
|
if (FldrpHwHeapLocation > HW_MAX_ARC_HEAP_SIZE) Buffer = NULL;
|
||||||
|
|
||||||
|
/* Clear it */
|
||||||
|
if (Buffer)
|
||||||
|
RtlZeroMemory(Buffer, Size);
|
||||||
|
|
||||||
/* Return the buffer */
|
/* Return the buffer */
|
||||||
return Buffer;
|
return Buffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue