dovecot-2.2: imap: Free mail_user only after client is disconnec...

dovecot at dovecot.org dovecot at dovecot.org
Fri Nov 27 12:12:09 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/1217e5610865
changeset: 19422:1217e5610865
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Nov 27 14:01:14 2015 +0200
description:
imap: Free mail_user only after client is disconnected.

diffstat:

 src/imap/imap-client.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 82e6a3baa001 -r 1217e5610865 src/imap/imap-client.c
--- a/src/imap/imap-client.c	Fri Nov 27 13:59:22 2015 +0200
+++ b/src/imap/imap-client.c	Fri Nov 27 14:01:14 2015 +0200
@@ -367,7 +367,6 @@
 			mail_user_get_anvil_userip_ident(client->user),
 			"\n", NULL));
 	}
-	mail_user_unref(&client->user);
 
 	if (client->free_parser != NULL)
 		imap_parser_unref(&client->free_parser);
@@ -386,6 +385,10 @@
 	if (client->fd_in != client->fd_out)
 		net_disconnect(client->fd_out);
 
+	/* Free the user after client is already disconnected. It may start
+	   some background work like autoexpunging. */
+	mail_user_unref(&client->user);
+
 	if (array_is_created(&client->search_saved_uidset))
 		array_free(&client->search_saved_uidset);
 	if (array_is_created(&client->search_updates))


More information about the dovecot-cvs mailing list