delete aProfile;
if (NS_SUCCEEDED(rv)) { rv = enumKeys->First();   while( NS_SUCCEEDED( rv ) && (NS_OK != enumKeys->IsDone()) ) { nsCOMPtr<nsISupports> base; rv = enumKeys->CurrentItem(getter_AddRefs(base));   if (NS_SUCCEEDED(rv)) {  nsIRegistryNode *value; nsIID valueIID = NS_IREGISTRYVALUE_IID; rv = base->QueryInterface( valueIID, (void**)&value );   if (NS_SUCCEEDED(rv)) {  char *entryName; char *entryValue;  rv = value->GetName( &entryName );  if (NS_SUCCEEDED(rv)) { rv = m_reg->GetString( sourceKey, entryName, &entryValue);
nsresult nsProfile::CopyRegKey(const PRUnichar *oldProfile, const PRUnichar *newProfile){    NS_ENSURE_ARG_POINTER(oldProfile);       NS_ENSURE_ARG_POINTER(newProfile);       nsresult rv = NS_OK;    ProfileStruct    *aProfile;    rv = gProfileDataAccess->GetValue(oldProfile, &aProfile);    if (NS_FAILED(rv)) return rv;    aProfile->profileName        = newProfile;    rv = gProfileDataAccess->SetValue(aProfile);	delete aProfile;    return rv;}