bug #85271: sr=waterson, r={beard, jag, dbaron}, a=asa. Eliminate features of |nsXPIDLC?String| that keep it out of the string hierarchy (i.e., using assigment to rebind ownership, static |Copy| members, and |getter_Shares|), fixing some leaks in the process.

git-svn-id: svn://10.0.0.236/trunk@234760 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
scc%mozilla.org 2007-09-06 21:58:05 +00:00
parent 88ec3d1cbc
commit f06ec165a0
2 changed files with 3 additions and 3 deletions

View File

@ -932,7 +932,7 @@ InternetSearchDataSource::GetURI(char **uri)
if (! uri)
return NS_ERROR_NULL_POINTER;
if ((*uri = nsXPIDLCString::Copy("rdf:internetsearch")) == nsnull)
if ((*uri = nsCRT::strdup("rdf:internetsearch")) == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
@ -4504,7 +4504,7 @@ InternetSearchDataSource::OnStopRequest(nsIRequest *request, nsISupports *ctxt,
lastModValue = val;
if (NS_SUCCEEDED(httpChannel->GetResponseHeader("Content-Length", getter_Copies(val))))
contentLengthValue = val;
val = 0;
val.Adopt(0);
// should we fetch the entire file?
PRBool updateSearchEngineFile = PR_FALSE;

View File

@ -148,7 +148,7 @@ LocalSearchDataSource::GetURI(char **uri)
if (! uri)
return NS_ERROR_NULL_POINTER;
if ((*uri = nsXPIDLCString::Copy("rdf:localsearch")) == nsnull)
if ((*uri = nsCRT::strdup("rdf:localsearch")) == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;