Skip to content

Commit 82b11d5

Browse files
committed
Call "VirtualFree" before setting error (fixes #23).
1 parent 0ce2454 commit 82b11d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MemoryModule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data,
498498

499499
result = (PMEMORYMODULE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MEMORYMODULE));
500500
if (result == NULL) {
501-
SetLastError(ERROR_OUTOFMEMORY);
502501
VirtualFree(code, 0, MEM_RELEASE);
502+
SetLastError(ERROR_OUTOFMEMORY);
503503
return NULL;
504504
}
505505

0 commit comments

Comments
 (0)