Synchronize with trunk revision 59636 (just before Alex's CreateProcess revamp).
[reactos.git] / include / xdk / exfuncs.h
index df3338f..a60908f 100644 (file)
@@ -276,9 +276,10 @@ static __inline PVOID
 ExAllocateFromZone(
   IN PZONE_HEADER Zone)
 {
+  PVOID Result = (PVOID)Zone->FreeList.Next;
   if (Zone->FreeList.Next)
     Zone->FreeList.Next = Zone->FreeList.Next->Next;
-  return (PVOID) Zone->FreeList.Next;
+  return Result;
 }
 
 static __inline PVOID