]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
*-login: Call client_vfuncs.destroy() on client_destroy(), not on unref.
authorTimo Sirainen <tss@iki.fi>
Tue, 11 Aug 2009 18:08:09 +0000 (14:08 -0400)
committerTimo Sirainen <tss@iki.fi>
Tue, 11 Aug 2009 18:08:09 +0000 (14:08 -0400)
--HG--
branch : HEAD

src/imap-login/client.c
src/login-common/client-common.c
src/pop3-login/client.c

index c9c9dcf099f1fcbf28279098c224b1379a116b69..965be1199d4ef396bb32e5231fe2741aea013f09 100644 (file)
@@ -264,7 +264,7 @@ static bool client_handle_input(struct imap_client *client)
                        "Error in IMAP command received by server.");
        }
 
-       return ret != 0;
+       return ret != 0 && !client->common.destroyed;
 }
 
 static void imap_client_input(struct client *client)
index 92c8aef665247e0d44e675a235182ce9b250efc1..be67626d751d5def3708e2535ee83eec7f62ff4e 100644 (file)
@@ -154,6 +154,7 @@ void client_destroy(struct client *client, const char *reason)
                login_proxy_free(&client->login_proxy);
        if (client->ssl_proxy != NULL)
                ssl_proxy_free(&client->ssl_proxy);
+       client->v.destroy(client);
        client_unref(client);
 }
 
@@ -196,7 +197,6 @@ bool client_unref(struct client *client)
 
        i_free(client->virtual_user);
        i_free(client->auth_mech_name);
-       client->v.destroy(client);
        pool_unref(&client->pool);
        return FALSE;
 }
index 891fdb4d57dbb76059ab875f5918c31c053220a0..b82dad4e43cb452360ed06e885c1c9d1696a1a9c 100644 (file)
@@ -113,8 +113,8 @@ static void pop3_client_destroy(struct client *client)
 {
        struct pop3_client *pop3_client = (struct pop3_client *)client;
 
-       i_free(pop3_client->last_user);
-       i_free(pop3_client->apop_challenge);
+       i_free_and_null(pop3_client->last_user);
+       i_free_and_null(pop3_client->apop_challenge);
 }
 
 static char *get_apop_challenge(struct pop3_client *client)