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: // Start by removing all disallowed proxies if required:
if (!(info.flags & nsIProtocolHandler::ALLOWS_PROXY_HTTP)) { if (!(info.flags & nsIProtocolHandler::ALLOWS_PROXY_HTTP)) {
nsProxyInfo *last = nsnull; nsProxyInfo *last = nsnull, *iter = head;
for (nsProxyInfo *iter = head; iter; iter = iter->mNext, last = iter) { while (iter) {
if (iter->Type() == kProxyType_HTTP) { if (iter->Type() == kProxyType_HTTP) {
// reject! // reject!
if (last) if (last)
last->mNext = iter->mNext; last->mNext = iter->mNext;
else else
head = iter->mNext; head = iter->mNext;
nsProxyInfo *next = iter->mNext;
iter->mNext = nsnull; iter->mNext = nsnull;
NS_RELEASE(iter); iter->Release();
iter = next;
} else {
last = iter;
iter = iter->mNext;
} }
} }
if (!head) if (!head)