nsresult rv = NS_MakeAbsoluteURI(specStr, baseURI, &resultStr); nsAllocator::Free(specStr); if (NS_FAILED(rv)) return rv;  result = resultStr; nsAllocator::Free(resultStr); return rv;
return baseURI->Resolve(spec, result);
NS_MakeAbsoluteURI(const nsString& spec, nsIURI* baseURI, nsString& result){    char* resultStr;    char* specStr = spec.ToNewCString();    if (!specStr) {        return NS_ERROR_OUT_OF_MEMORY;    }    nsresult rv = NS_MakeAbsoluteURI(specStr, baseURI, &resultStr);    nsAllocator::Free(specStr);    if (NS_FAILED(rv)) return rv;    result = resultStr;    nsAllocator::Free(resultStr);    return rv;}