appwiz.cpl: Do not access memory after HeapFree in FreeAppInfo.

This commit is contained in:
Detlef Riekenberg 2008-07-25 16:41:38 +02:00 committed by Alexandre Julliard
parent 352d857059
commit 8ed31e2c38
1 changed files with 9 additions and 19 deletions

View File

@ -110,27 +110,17 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
*/
static void FreeAppInfo(APPINFO *info)
{
APPINFO *iter = info;
while (iter)
while (info)
{
if (iter->title)
HeapFree(GetProcessHeap(), 0, iter->title);
APPINFO *next_info = info->next;
if (iter->path)
HeapFree(GetProcessHeap(), 0, iter->path);
if (iter->icon)
HeapFree(GetProcessHeap(), 0, iter->icon);
if (iter->publisher)
HeapFree(GetProcessHeap(), 0, iter->publisher);
if (iter->version)
HeapFree(GetProcessHeap(), 0, iter->version);
iter = iter->next;
HeapFree(GetProcessHeap(), 0, iter);
HeapFree(GetProcessHeap(), 0, info->title);
HeapFree(GetProcessHeap(), 0, info->path);
HeapFree(GetProcessHeap(), 0, info->icon);
HeapFree(GetProcessHeap(), 0, info->publisher);
HeapFree(GetProcessHeap(), 0, info->version);
HeapFree(GetProcessHeap(), 0, info);
info = next_info;
}
}