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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user