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; pListEntry = g_ATSHostList.Flink;
while (pListEntry != &g_ATSHostList) if (pListEntry)
{ {
pHostEntry = CONTAINING_RECORD(pListEntry, ATSHostEntry, listEntry); while (pListEntry != &g_ATSHostList)
RemoveEntryList(pListEntry); {
free(pHostEntry->pNameAndPort); pHostEntry = CONTAINING_RECORD(pListEntry, ATSHostEntry, listEntry);
free(pHostEntry->pName); RemoveEntryList(pListEntry);
free(pHostEntry); free(pHostEntry->pNameAndPort);
pListEntry = g_ATSHostList.Flink; free(pHostEntry->pName);
free(pHostEntry);
pListEntry = g_ATSHostList.Flink;
}
} }
DbgTrace(1, "-UnInitializeLibrary- End\n", 0); DbgTrace(1, "-UnInitializeLibrary- End\n", 0);