nsresult rv = NS_OK; nsDocLoaderImpl * newLoader = new nsDocLoaderImpl(); NS_ENSURE_TRUE(newLoader, NS_ERROR_OUT_OF_MEMORY);  NS_ADDREF(newLoader); newLoader->Init();
if (nsnull == anInstance) { rv = NS_ERROR_NULL_POINTER; goto done; }
nsDocLoaderImpl::CreateDocumentLoader(nsIDocumentLoader** anInstance){  nsresult rv = NS_OK;  nsDocLoaderImpl * newLoader = new nsDocLoaderImpl();  NS_ENSURE_TRUE(newLoader, NS_ERROR_OUT_OF_MEMORY);    NS_ADDREF(newLoader);  newLoader->Init();  // Initialize now that we have a reference  rv = newLoader->SetDocLoaderParent(this);  if (NS_SUCCEEDED(rv)) {    //    // XXX this method incorrectly returns a bool        //    rv = mChildList->AppendElement((nsIDocumentLoader*)newLoader)        ? NS_OK : NS_ERROR_FAILURE;  }    rv = newLoader->QueryInterface(NS_GET_IID(nsIDocumentLoader), (void **) anInstance);  NS_RELEASE(newLoader);  return rv;}