changeset 12445:9c96b54c8a76

pop3: Avoid crash when updating proctitle if client init fails.
author Timo Sirainen <tss@iki.fi>
date Thu, 18 Nov 2010 18:57:18 +0000
parents 1afad049f37f
children 7446b066fc75
files src/pop3/pop3-client.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/pop3/pop3-client.c	Thu Nov 18 18:56:34 2010 +0000
+++ b/src/pop3/pop3-client.c	Thu Nov 18 18:57:18 2010 +0000
@@ -252,8 +252,6 @@
 	net_set_nonblock(fd_in, TRUE);
 	net_set_nonblock(fd_out, TRUE);
 
-	pop3_client_count++;
-
 	client = i_new(struct client, 1);
 	client->service_user = service_user;
 	client->set = set;
@@ -274,6 +272,9 @@
 
 	client->user = user;
 
+	pop3_client_count++;
+	DLLIST_PREPEND(&pop3_clients, client);
+
 	inbox = "INBOX";
 	ns = mail_namespace_find(user->namespaces, &inbox);
 	if (ns == NULL) {
@@ -326,7 +327,6 @@
 		client->anvil_sent = TRUE;
 	}
 
-	DLLIST_PREPEND(&pop3_clients, client);
 	if (hook_client_created != NULL)
 		hook_client_created(&client);