fix 45430. patch proposed by beard@netscape.com r=ftang a=ftang

fix memory leak
This commit is contained in:
ftang@netscape.com
2000-08-02 05:08:15 +00:00
parent 62a16f1f3f
commit 5d29261e9c
2 changed files with 10 additions and 12 deletions

View File

@@ -724,6 +724,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
// like this because I think it's really bogus that layout is depending on bookmarks. This is very evil.
nsXPIDLCString scheme;
aURL->GetScheme(getter_Copies(scheme));
if (scheme && nsCRT::strcasecmp("about", scheme) && (kCharsetFromBookmarks > charsetSource))
{
nsCOMPtr<nsIRDFDataSource> datasource;
@@ -732,14 +733,14 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsCOMPtr<nsIBookmarksService> bookmarks = do_QueryInterface(datasource);
if (bookmarks)
{
char* urlSpec = nsnull;
aURL->GetSpec(&urlSpec);
nsXPIDLCString urlSpec;
aURL->GetSpec(getter_Copies(urlSpec));
if (urlSpec)
{
PRUnichar *pBookmarkedCharset;
nsXPIDLString pBookmarkedCharset;
if (NS_SUCCEEDED(rv = bookmarks->GetLastCharset(urlSpec, &pBookmarkedCharset)) &&
if (NS_SUCCEEDED(rv = bookmarks->GetLastCharset(urlSpec, getter_Copies(pBookmarkedCharset))) &&
(rv != NS_RDF_NO_VALUE))
{
charset = pBookmarkedCharset;
@@ -747,8 +748,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
}
}
nsCRT::free(urlSpec);
}
}
}