mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 06:09:19 +00:00
fix 45430. patch proposed by beard@netscape.com r=ftang a=ftang
fix memory leak
This commit is contained in:
parent
0800dcc896
commit
511e6b5315
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user