fix for #79371; crash or app failure when Proxy type = PAC, sr=darin; r=gagan; a=asa

This commit is contained in:
serge%netscape.com 2001-05-31 01:56:21 +00:00
parent 4e3f209b90
commit d377ead1ee

View File

@ -408,7 +408,21 @@ nsProtocolProxyService::ExamineForProxy(nsIURI *aURI, char * *aProxyHost, PRInt3
aProxyHost,
aProxyPort,
aProxyType);
if (NS_SUCCEEDED(rv)) {
if (*aProxyType == nsnull || !PL_strcasecmp("direct", *aProxyType)) {
if (*aProxyHost) {
nsMemory::Free(*aProxyHost);
*aProxyHost = nsnull;
}
if (*aProxyType) {
nsMemory::Free(*aProxyType);
*aProxyType = nsnull;
}
*aProxyPort = -1;
} else if (*aProxyPort <= 0) {
*aProxyPort = -1;
}
}
return rv;
}