[NTVDM]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Mon, 13 Apr 2015 12:50:34 +0000 (12:50 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Mon, 13 Apr 2015 12:50:34 +0000 (12:50 +0000)
Initialize the list of hooks before the call to NtAllocateVirtualMemory, to prevent crashes
in MemCleanup in case it fails.

svn path=/trunk/; revision=67186

reactos/subsystems/mvdm/ntvdm/memory.c

index 7bbe7c9..f5cb23a 100644 (file)
@@ -583,6 +583,8 @@ MemInitialize(VOID)
     NTSTATUS Status;
     SIZE_T MemorySize = MAX_ADDRESS; // See: kernel32/client/vdm.c!BaseGetVdmConfigInfo
 
+    InitializeListHead(&HookList);
+
 #ifndef STANDALONE
 
     /*
@@ -626,8 +628,6 @@ MemInitialize(VOID)
     ASSERT(BaseAddress == NULL);
 #endif
 
-    InitializeListHead(&HookList);
-
     /*
      * For diagnostics purposes, we fill the memory with INT 0x03 codes
      * so that if a program wants to execute random code in memory, we can