Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mhook-lib/mhook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,12 @@ static MHOOKS_TRAMPOLINE* BlockAlloc(PBYTE pSystemFunction, PBYTE pbLower, PBYTE
pRetVal[s].pNextTrampoline = &pRetVal[s + 1];
}

// last entry points to the current head of the free list
// last entry points to the current head of the free list and
// the current head points back to the last entry of the new block
pRetVal[trampolineCount - 1].pNextTrampoline = g_pFreeList;
if (g_pFreeList) {
g_pFreeList->pPrevTrampoline = &pRetVal[trampolineCount - 1];
}
break;
}
}
Expand Down