mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
NECKO only: changed string/error handling in NS_MakeAbsoluteURI A: chofmann R: valeski
This commit is contained in:
parent
0954d17559
commit
b0a1bfd2ff
@ -117,10 +117,13 @@ NS_MakeAbsoluteURI(const char* spec, nsIURI* baseURI, char* *result)
|
|||||||
nsresult
|
nsresult
|
||||||
NS_MakeAbsoluteURI(const nsString& spec, nsIURI* baseURI, nsString& result)
|
NS_MakeAbsoluteURI(const nsString& spec, nsIURI* baseURI, nsString& result)
|
||||||
{
|
{
|
||||||
char* specStr = spec.ToNewCString();
|
|
||||||
char* resultStr;
|
char* resultStr;
|
||||||
|
char* specStr = spec.ToNewCString();
|
||||||
|
if (!specStr) {
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
nsresult rv = NS_MakeAbsoluteURI(specStr, baseURI, &resultStr);
|
nsresult rv = NS_MakeAbsoluteURI(specStr, baseURI, &resultStr);
|
||||||
nsCRT::free(specStr);
|
delete [] specStr;
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
result = resultStr;
|
result = resultStr;
|
||||||
|
Loading…
Reference in New Issue
Block a user