plug leak in CheckForTrailingSlash. r:nisheeth

git-svn-id: svn://10.0.0.236/trunk@24703 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
danm%netscape.com
1999-03-22 21:53:58 +00:00
parent 3fbd23b07e
commit 5065fcea60
2 changed files with 6 additions and 4 deletions

View File

@@ -2269,13 +2269,14 @@ nsresult nsWebShell::CheckForTrailingSlash(nsIURL* aURL)
aURL->GetSpec(&spec);
nsString* newURL = (nsString*) new nsString(spec);
if (newURL->Last() == '/' && !historyURL->Equals(*newURL)) {
if (newURL && newURL->Last() == '/' && !historyURL->Equals(*newURL)) {
// Replace the top most history entry with the new url
if (nsnull != historyURL) {
delete historyURL;
}
mHistory.ReplaceElementAt(newURL, mHistoryIndex);
}
} else
delete newURL;
return NS_OK;
}