Skip to content

Commit e952dd3

Browse files
committed
fixed memory leak (VirtualFree must be called with zero size when releasing memory)
1 parent be334a2 commit e952dd3

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
@@ -460,7 +460,7 @@ void MemoryFreeLibrary(HMEMORYMODULE mod)
460460

461461
if (module->codeBase != NULL)
462462
// release memory of library
463-
VirtualFree(module->codeBase, module->headers->OptionalHeader.SizeOfImage, MEM_RELEASE);
463+
VirtualFree(module->codeBase, 0, MEM_RELEASE);
464464

465465
HeapFree(GetProcessHeap(), 0, module);
466466
}

0 commit comments

Comments
 (0)