зеркало из https://github.com/mozilla/gecko-dev.git
plug leak in CheckForTrailingSlash. r:nisheeth
This commit is contained in:
Родитель
9722af1758
Коммит
493f3c64d9
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче