diff --git a/xpinstall/src/nsInstallTrigger.cpp b/xpinstall/src/nsInstallTrigger.cpp index 5e7855e7553..3a202a13817 100644 --- a/xpinstall/src/nsInstallTrigger.cpp +++ b/xpinstall/src/nsInstallTrigger.cpp @@ -138,10 +138,12 @@ nsInstallTrigger::HandleContent(const char * aContentType, rv = aChannel->GetURI(getter_AddRefs(uri)); if (NS_FAILED(rv)) return rv; + request->Cancel(NS_BINDING_ABORTED); + if (uri) { - char* spec; - uri->GetSpec(&spec); - if (!spec) + nsXPIDLCString spec; + rv = uri->GetSpec(getter_Copies(spec)); + if (NS_FAILED(rv)) return NS_ERROR_NULL_POINTER; nsCOMPtr globalObjectOwner = do_QueryInterface(aWindowContext); @@ -153,8 +155,6 @@ nsInstallTrigger::HandleContent(const char * aContentType, { PRBool value; rv = StartSoftwareUpdate(globalObject, NS_ConvertASCIItoUCS2(spec), 0, &value); - - nsMemory::Free(spec); if (NS_SUCCEEDED(rv) && value) return NS_OK;