fixes bug 287956 "Crash shortly after program start [@nsProtocolProxyService::PruneProxyInfo]" r=biesi

This commit is contained in:
darin%meer.net 2005-03-28 20:11:16 +00:00
Родитель 10724acafd
Коммит 5e478b9d08
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -1319,16 +1319,21 @@ nsProtocolProxyService::PruneProxyInfo(const nsProtocolInfo &info,
// Start by removing all disallowed proxies if required:
if (!(info.flags & nsIProtocolHandler::ALLOWS_PROXY_HTTP)) {
nsProxyInfo *last = nsnull;
for (nsProxyInfo *iter = head; iter; iter = iter->mNext, last = iter) {
nsProxyInfo *last = nsnull, *iter = head;
while (iter) {
if (iter->Type() == kProxyType_HTTP) {
// reject!
if (last)
last->mNext = iter->mNext;
else
head = iter->mNext;
nsProxyInfo *next = iter->mNext;
iter->mNext = nsnull;
NS_RELEASE(iter);
iter->Release();
iter = next;
} else {
last = iter;
iter = iter->mNext;
}
}
if (!head)