PR_Free(accountKey); accountKey = nsnull; account = nsnull; token = nsCRT::strtok(rest, ",", &rest);
nsCOMPtr<nsIMsgIncomingServer> server; account->GetIncomingServer(getter_AddRefs(server));  token = nsCRT::strtok(newStr, ",", &newStr);
nsMsgAccountManager::LoadAccounts(){  nsresult rv;  NS_IF_RELEASE(m_prefs);  rv = nsServiceManager::GetService(kPrefServiceCID,                                    nsIPref::GetIID(),                                    (nsISupports**)&m_prefs);  if (NS_FAILED(rv)) return rv;    char *accountList = nsnull;  rv = m_prefs->CopyCharPref("mail.accountmanager.accounts", &accountList);  if (NS_FAILED(rv) || !accountList || !accountList[0]) {    // create default bogus accounts    printf("No accounts. I'll try to migrate 4.x prefs..\n");    rv = upgradePrefs();    return rv;  }  else {        /* parse accountList and run loadAccount on each string, comma-separated */#ifdef DEBUG_sspitzer    printf("accountList = %s\n", accountList);#endif       nsIMsgAccount *account = nsnull;    char *accountKey = nsnull;    char *token = nsnull;    char *rest = accountList;    token = nsCRT::strtok(rest, ",", &rest);    while (token && *token) {      accountKey = PL_strdup(token);#ifdef DEBUG_sspitzer      printf("accountKey = %s\n", accountKey);#endif      account = LoadAccount(accountKey);      if (account) {        addAccount(account);      }      else {        return NS_ERROR_NULL_POINTER;      }            PR_Free(accountKey);      accountKey = nsnull;      account = nsnull;      token = nsCRT::strtok(rest, ",", &rest);    }    /* finished loading accounts */    PR_Free(accountList);    accountList = nsnull;    return NS_OK;  }}