Call "VirtualFree" before setting error (fixes #23).

This commit is contained in:
Joachim Bauch
2015-03-13 16:56:02 +01:00
parent 0ce2454fc3
commit 82b11d57db
+1 -1
View File
@@ -498,8 +498,8 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data,
result = (PMEMORYMODULE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MEMORYMODULE));
if (result == NULL) {
SetLastError(ERROR_OUTOFMEMORY);
VirtualFree(code, 0, MEM_RELEASE);
SetLastError(ERROR_OUTOFMEMORY);
return NULL;
}