diff --git a/src/hook.c b/src/hook.c index f1132fbf..7b171f03 100644 --- a/src/hook.c +++ b/src/hook.c @@ -479,7 +479,8 @@ MH_STATUS WINAPI MH_Uninitialize(VOID) // Free the internal function buffer. UninitializeBuffer(); - HeapDestroy(g_hHeap); + HeapFree(g_hHeap, 0, g_hooks.pItems); + HeapDestroy(g_hHeap); g_hHeap = NULL;