From: Timo Sirainen Date: Tue, 11 Aug 2009 18:08:09 +0000 (-0400) Subject: *-login: Call client_vfuncs.destroy() on client_destroy(), not on unref. X-Git-Tag: 2.0.alpha1~287 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=05e55893a799de645fc8cd2203d6013f0e0f1b79;p=thirdparty%2Fdovecot%2Fcore.git *-login: Call client_vfuncs.destroy() on client_destroy(), not on unref. --HG-- branch : HEAD --- diff --git a/src/imap-login/client.c b/src/imap-login/client.c index c9c9dcf099..965be1199d 100644 --- a/src/imap-login/client.c +++ b/src/imap-login/client.c @@ -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) diff --git a/src/login-common/client-common.c b/src/login-common/client-common.c index 92c8aef665..be67626d75 100644 --- a/src/login-common/client-common.c +++ b/src/login-common/client-common.c @@ -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; } diff --git a/src/pop3-login/client.c b/src/pop3-login/client.c index 891fdb4d57..b82dad4e43 100644 --- a/src/pop3-login/client.c +++ b/src/pop3-login/client.c @@ -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)