mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
rpcrt4: Fix memory leak in NdrFullPointerXlatFree. <rob at codeweavers.com>
First of all, the code was freeing the wrong pointer (i.e. the pointer supplied by the caller of one of the NdrFullPointer* functions, not the PFULL_PTR_TO_REFID_ELEMENT. Second, the code wasn't following the Next link to the next entry in the list. svn path=/trunk/; revision=31852
This commit is contained in:
parent
bf565b3d3a
commit
02f7a25753
1 changed files with 11 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue