]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3: Avoid crash when updating proctitle if client init fails.
authorTimo Sirainen <tss@iki.fi>
Thu, 18 Nov 2010 18:57:18 +0000 (18:57 +0000)
committerTimo Sirainen <tss@iki.fi>
Thu, 18 Nov 2010 18:57:18 +0000 (18:57 +0000)
src/pop3/pop3-client.c

index 125aa60d6983314fa67ca9db86b1688f19f7aae5..693f86173f9344d7e15738b522bf770ae94cfbef 100644 (file)
@@ -252,8 +252,6 @@ struct client *client_create(int fd_in, int fd_out, struct mail_user *user,
        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 @@ struct client *client_create(int fd_in, int fd_out, struct mail_user *user,
 
        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 @@ struct client *client_create(int fd_in, int fd_out, struct mail_user *user,
                client->anvil_sent = TRUE;
        }
 
-       DLLIST_PREPEND(&pop3_clients, client);
        if (hook_client_created != NULL)
                hook_client_created(&client);