nsAllocator::Free(uri);
nsXPINotifierImpl::Init(){    PRBool enabled;    NotificationEnabled(&enabled);    if (!enabled)        return NS_ERROR_FAILURE;        if (mInner == nsnull)        return NS_ERROR_FAILURE;    nsresult rv;    nsCOMPtr<nsIRDFDataSource> distributors;    nsCOMPtr<nsIRDFContainer> distributorsContainer;    nsCOMPtr <nsISimpleEnumerator> distributorEnumerator;    PRBool moreElements;        // Read the distributor registry    rv = nsServiceManager::GetService(kRDFServiceCID, nsIRDFService::GetIID(), (nsISupports**) &mRDF);    if (NS_FAILED(rv)) return rv;        if (! kXPI_NotifierSources)	{	   mRDF->GetResource(NC_XPIFLASH_SOURCES,       &kXPI_NotifierSources);       mRDF->GetResource(NC_XPIFLASH_PACKAGES,      &kXPI_NotifierPackages);       mRDF->GetResource(NC_XPIFLASH_TITLE,         &kXPI_NotifierPackage_Title);       mRDF->GetResource(NC_XPIFLASH_VERSION,       &kXPI_NotifierPackage_Version);       mRDF->GetResource(NC_XPIFLASH_DESCRIPTION,   &kXPI_NotifierPackage_Description);       mRDF->GetResource(NC_XPIFLASH_REGKEY,        &kXPI_NotifierPackage_RegKey);       mRDF->GetResource(NC_XPIFLASH_URL,           &kXPI_NotifierPackage_URL);       mRDF->GetResource(NC_XPIFLASH_TYPE,          &kXPI_Notifier_Type);                     mRDF->GetResource(NC_RDF_FLASHROOT,          &kNC_FlashRoot);	   mRDF->GetResource(NC_RDF_TYPE,               &kNC_Type);	   mRDF->GetResource(NC_RDF_SOURCE,             &kNC_Source);	   mRDF->GetResource(NC_RDF_DESCRIPTION,        &kNC_Description);	   mRDF->GetResource(NC_RDF_TIMESTAMP,          &kNC_TimeStamp);	   mRDF->GetResource(NC_RDF_URL,                &kNC_URL);	   mRDF->GetResource(NC_RDF_CHILD,              &kNC_Child);	}    rv = OpenRemoteDataSource("resource:/res/xpinstall/SoftwareUpdates.rdf", PR_TRUE, getter_AddRefs(distributors));    if (NS_FAILED(rv)) return rv;    rv = nsComponentManager::CreateInstance(kRDFContainerCID,                                            nsnull,                                            nsIRDFContainer::GetIID(),                                            getter_AddRefs(distributorsContainer));    if (NS_SUCCEEDED(rv))    {        rv = distributorsContainer->Init(distributors, kXPI_NotifierSources);                if (NS_SUCCEEDED(rv))        {            rv = distributorsContainer->GetElements(getter_AddRefs(distributorEnumerator));            if (NS_SUCCEEDED(rv))            {                distributorEnumerator->HasMoreElements(&moreElements);                while (moreElements)                 {                    nsCOMPtr<nsISupports> i;                    rv = distributorEnumerator->GetNext(getter_AddRefs(i));                    if (NS_FAILED(rv)) break;                    nsCOMPtr<nsIRDFResource> aDistributor(do_QueryInterface(i, &rv));                    if (NS_FAILED(rv)) break;                    char* uri;                    nsCOMPtr<nsIRDFDataSource> remoteDatasource;                    aDistributor->GetValue(&uri);                    rv = OpenRemoteDataSource(uri, PR_FALSE, getter_AddRefs(remoteDatasource));                    if (NS_FAILED(rv)) break;                                        distributorEnumerator->HasMoreElements(&moreElements);                }            }        }    }    return NS_OK;}