[ros-diffs] [cwittich] 31179: only clear it when the buffer is valid

cwittich at svn.reactos.org cwittich at svn.reactos.org
Wed Dec 12 10:18:00 CET 2007


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/reactos/archwsup.c?rev=31179&r1=31178&r2=31179&view=diff
==============================================================================
--- 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;
 }




More information about the Ros-diffs mailing list