hostSession->AddHostToList(hostName, userName); PR_FREEIF(userName); PR_FREEIF(hostName);
hostSession->AddHostToList(aKey);  char *personalNamespace = nsnull; char *publicNamespace = nsnull; char *otherUsersNamespace = nsnull;  rv = GetPersonalNamespace(&personalNamespace); rv = GetPublicNamespace(&publicNamespace); rv = GetOtherUsersNamespace(&otherUsersNamespace);  if (!personalNamespace && !publicNamespace && !otherUsersNamespace) personalNamespace = PL_strdup("\"\"");  if (NS_SUCCEEDED(rv)) { hostSession->SetNamespaceFromPrefForHost(aKey, personalNamespace, kPersonalNamespace); PR_FREEIF(personalNamespace); }  if (NS_SUCCEEDED(rv)) { hostSession->SetNamespaceFromPrefForHost(aKey, publicNamespace, kPublicNamespace); PR_FREEIF(publicNamespace); }  if (NS_SUCCEEDED(rv)) { hostSession->SetNamespaceFromPrefForHost(aKey, otherUsersNamespace, kOtherUsersNamespace); PR_FREEIF(otherUsersNamespace); }
NS_IMETHODIMP nsImapIncomingServer::SetKey(char * aKey)  // override nsMsgIncomingServer's implementation...{	nsMsgIncomingServer::SetKey(aKey);	// okay now that the key has been set, we need to add ourselves to the	// host session list...	// every time we create an imap incoming server, we need to add it to the	// host session list!! 	// get the user and host name and the fields to the host session list.	char * userName = nsnull;	char * hostName = nsnull;		nsresult rv = GetHostName(&hostName);	rv = GetUsername(&userName);	NS_WITH_SERVICE(nsIImapHostSessionList, hostSession, kCImapHostSessionList, &rv);    if (NS_FAILED(rv)) return rv;	hostSession->AddHostToList(hostName, userName);	PR_FREEIF(userName);	PR_FREEIF(hostName);	return rv;}