[TASKMGR] Fix PerfDataDeallocCommandLineCache

Do not leak memory. CORE-18014
This commit is contained in:
Katayama Hirofumi MZ 2023-06-15 15:36:19 +09:00
parent 7989e3f26c
commit 9a6c85f68a

View file

@ -649,16 +649,15 @@ cleanup:
void PerfDataDeallocCommandLineCache()
{
PCMD_LINE_CACHE cache = global_cache;
PCMD_LINE_CACHE cache_old;
PCMD_LINE_CACHE cache, pnext;
while (cache && cache->pnext != NULL)
for (cache = global_cache; cache; cache = pnext)
{
cache_old = cache;
cache = cache->pnext;
HeapFree(GetProcessHeap(), 0, cache_old);
pnext = cache->pnext;
HeapFree(GetProcessHeap(), 0, cache);
}
global_cache = NULL;
}
ULONG PerfDataGetSessionId(ULONG Index)