NS_NEWXPCOM(newLoader, nsDocLoaderImpl); if (nsnull == newLoader) { *anInstance = nsnull; rv = NS_ERROR_OUT_OF_MEMORY; goto done; } rv = newLoader->QueryInterface(kIDocumentLoaderIID, (void**)anInstance); if (NS_SUCCEEDED(rv)) { AddChildGroup(newLoader); newLoader->SetParent(this); }  done:
rv = newLoader->QueryInterface(NS_GET_IID(nsIDocumentLoader), (void **) anInstance); NS_RELEASE(newLoader);
nsDocLoaderImpl::CreateDocumentLoader(nsIDocumentLoader** anInstance){  nsDocLoaderImpl* newLoader = nsnull;  nsresult rv = NS_OK;  /* Check for initial error conditions... */  if (nsnull == anInstance) {    rv = NS_ERROR_NULL_POINTER;     goto done;  }  NS_NEWXPCOM(newLoader, nsDocLoaderImpl);  if (nsnull == newLoader) {    *anInstance = nsnull;    rv = NS_ERROR_OUT_OF_MEMORY;    goto done;  }  rv = newLoader->QueryInterface(kIDocumentLoaderIID, (void**)anInstance);  if (NS_SUCCEEDED(rv)) {    AddChildGroup(newLoader);    newLoader->SetParent(this);  }done:  return rv;}