dovecot-2.0: *-login: Call client_vfuncs.destroy() on client_des...

dovecot at dovecot.org dovecot at dovecot.org
Wed Aug 12 00:00:00 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/935b9cfc1905
changeset: 9765:935b9cfc1905
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 11 14:08:09 2009 -0400
description:
*-login: Call client_vfuncs.destroy() on client_destroy(), not on unref.

diffstat:

3 files changed, 4 insertions(+), 4 deletions(-)
src/imap-login/client.c          |    2 +-
src/login-common/client-common.c |    2 +-
src/pop3-login/client.c          |    4 ++--

diffs (45 lines):

diff -r e5e74a4f07e9 -r 935b9cfc1905 src/imap-login/client.c
--- a/src/imap-login/client.c	Tue Aug 11 12:47:54 2009 -0400
+++ b/src/imap-login/client.c	Tue Aug 11 14:08:09 2009 -0400
@@ -264,7 +264,7 @@ static bool client_handle_input(struct i
 			"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 -r e5e74a4f07e9 -r 935b9cfc1905 src/login-common/client-common.c
--- a/src/login-common/client-common.c	Tue Aug 11 12:47:54 2009 -0400
+++ b/src/login-common/client-common.c	Tue Aug 11 14:08:09 2009 -0400
@@ -154,6 +154,7 @@ void client_destroy(struct client *clien
 		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 -r e5e74a4f07e9 -r 935b9cfc1905 src/pop3-login/client.c
--- a/src/pop3-login/client.c	Tue Aug 11 12:47:54 2009 -0400
+++ b/src/pop3-login/client.c	Tue Aug 11 14:08:09 2009 -0400
@@ -113,8 +113,8 @@ static void pop3_client_destroy(struct c
 {
 	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)


More information about the dovecot-cvs mailing list