diff --git a/reactos/dll/win32/rpcrt4/ndr_fullpointer.c b/reactos/dll/win32/rpcrt4/ndr_fullpointer.c index 3586bc39e30..307e54540d0 100644 --- a/reactos/dll/win32/rpcrt4/ndr_fullpointer.c +++ b/reactos/dll/win32/rpcrt4/ndr_fullpointer.c @@ -68,8 +68,17 @@ void WINAPI NdrFullPointerXlatFree(PFULL_PTR_XLAT_TABLES pXlatTables) TRACE("(%p)\n", pXlatTables); /* free the entries in the table */ - for (i = 0; i < pXlatTables->RefIdToPointer.NumberOfEntries; i++) - HeapFree(GetProcessHeap(), 0, pXlatTables->RefIdToPointer.XlatTable[i]); + for (i = 0; i < pXlatTables->PointerToRefId.NumberOfBuckets; i++) + { + PFULL_PTR_TO_REFID_ELEMENT XlatTableEntry; + for (XlatTableEntry = pXlatTables->PointerToRefId.XlatTable[i]; + XlatTableEntry; ) + { + PFULL_PTR_TO_REFID_ELEMENT Next = XlatTableEntry->Next; + HeapFree(GetProcessHeap(), 0, XlatTableEntry); + XlatTableEntry = Next; + } + } HeapFree(GetProcessHeap(), 0, pXlatTables->RefIdToPointer.XlatTable); HeapFree(GetProcessHeap(), 0, pXlatTables->RefIdToPointer.StateTable);