mirror of
https://github.com/fancycode/MemoryModule
synced 2026-06-06 15:44:28 +00:00
fixed memory leak (VirtualFree must be called with zero size when releasing memory)
This commit is contained in:
+1
-1
@@ -460,7 +460,7 @@ void MemoryFreeLibrary(HMEMORYMODULE mod)
|
|||||||
|
|
||||||
if (module->codeBase != NULL)
|
if (module->codeBase != NULL)
|
||||||
// release memory of library
|
// release memory of library
|
||||||
VirtualFree(module->codeBase, module->headers->OptionalHeader.SizeOfImage, MEM_RELEASE);
|
VirtualFree(module->codeBase, 0, MEM_RELEASE);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, module);
|
HeapFree(GetProcessHeap(), 0, module);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user