nsDNSRecord *rec; if (!ai) rec = nsnull; else { rec = new nsDNSRecord(ai);
nsCOMPtr<nsIDNSRecord> rec; if (NS_SUCCEEDED(status)) { NS_ASSERTION(hostRecord, "no host record"); rec = new nsDNSRecord(hostRecord);
nsDNSAsyncRequest::OnLookupComplete(nsHostResolver *resolver,                                    const char     *host,                                    nsresult        status,                                    nsAddrInfo     *ai){    nsDNSRecord *rec;    if (!ai)        rec = nsnull;    else {        rec = new nsDNSRecord(ai);        if (!rec)            status = NS_ERROR_OUT_OF_MEMORY;    }    mListener->OnLookupComplete(this, rec, status);    mListener = nsnull;    // release the reference to ourselves that was added before we were    // handed off to the host resolver.    NS_RELEASE_THIS();}