mirror of
https://github.com/vxcontrol/MemoryModule.git
synced 2026-07-21 06:05:55 -04:00
Handle OOM case for result object.
This commit is contained in:
@@ -378,6 +378,14 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data,
|
||||
}
|
||||
|
||||
result = (PMEMORYMODULE)HeapAlloc(GetProcessHeap(), 0, sizeof(MEMORYMODULE));
|
||||
if (result == NULL) {
|
||||
#if DEBUG_OUTPUT
|
||||
OutputLastError("Can't reserve memory");
|
||||
#endif
|
||||
VirtualFree(code, 0, MEM_RELEASE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
result->codeBase = code;
|
||||
result->numModules = 0;
|
||||
result->modules = NULL;
|
||||
|
||||
Reference in New Issue
Block a user