Fixed crash that occurs when the DLL is unloaded before being initialized first.

This commit is contained in:
Juan Carlos Luciani 2007-06-27 22:01:44 +00:00
parent 329787a5a4
commit 41cc9deb34

View File

@ -1367,14 +1367,17 @@ UnInitializeLibrary(void)
}
pListEntry = g_ATSHostList.Flink;
while (pListEntry != &g_ATSHostList)
if (pListEntry)
{
pHostEntry = CONTAINING_RECORD(pListEntry, ATSHostEntry, listEntry);
RemoveEntryList(pListEntry);
free(pHostEntry->pNameAndPort);
free(pHostEntry->pName);
free(pHostEntry);
pListEntry = g_ATSHostList.Flink;
while (pListEntry != &g_ATSHostList)
{
pHostEntry = CONTAINING_RECORD(pListEntry, ATSHostEntry, listEntry);
RemoveEntryList(pListEntry);
free(pHostEntry->pNameAndPort);
free(pHostEntry->pName);
free(pHostEntry);
pListEntry = g_ATSHostList.Flink;
}
}
DbgTrace(1, "-UnInitializeLibrary- End\n", 0);