mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 17:10:22 +00:00
[TASKMGR] Fix PerfDataDeallocCommandLineCache
Do not leak memory. CORE-18014
This commit is contained in:
parent
7989e3f26c
commit
9a6c85f68a
1 changed files with 6 additions and 7 deletions
|
@ -649,16 +649,15 @@ cleanup:
|
||||||
|
|
||||||
void PerfDataDeallocCommandLineCache()
|
void PerfDataDeallocCommandLineCache()
|
||||||
{
|
{
|
||||||
PCMD_LINE_CACHE cache = global_cache;
|
PCMD_LINE_CACHE cache, pnext;
|
||||||
PCMD_LINE_CACHE cache_old;
|
|
||||||
|
|
||||||
while (cache && cache->pnext != NULL)
|
for (cache = global_cache; cache; cache = pnext)
|
||||||
{
|
{
|
||||||
cache_old = cache;
|
pnext = cache->pnext;
|
||||||
cache = cache->pnext;
|
HeapFree(GetProcessHeap(), 0, cache);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, cache_old);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global_cache = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG PerfDataGetSessionId(ULONG Index)
|
ULONG PerfDataGetSessionId(ULONG Index)
|
||||||
|
|
Loading…
Reference in a new issue