mirror of
https://github.com/reactos/reactos.git
synced 2024-07-11 07:05:12 +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 */
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue