Author: cwittich
Date: Wed Dec 12 12:17:59 2007
New Revision: 31179
URL:
http://svn.reactos.org/svn/reactos?rev=31179&view=rev
Log:
only clear it when the buffer is valid
Modified:
trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c Wed Dec 12 12:17:59 2007
@@ -29,13 +29,14 @@
/* 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;
}