dovecot-2.1: imapc: Crashfix when sometimes closing mailbox.

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 13 10:32:28 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/e60a3b29117c
changeset: 13458:e60a3b29117c
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 13 10:32:11 2011 +0300
description:
imapc: Crashfix when sometimes closing mailbox.

diffstat:

 src/lib-storage/index/imapc/imapc-client.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r 835891cf2eef -r e60a3b29117c src/lib-storage/index/imapc/imapc-client.c
--- a/src/lib-storage/index/imapc/imapc-client.c	Mon Sep 12 18:29:17 2011 +0300
+++ b/src/lib-storage/index/imapc/imapc-client.c	Tue Sep 13 10:32:11 2011 +0300
@@ -238,8 +238,6 @@
 	struct imapc_client_mailbox *box = *_box;
 	struct imapc_client_connection *const *connp;
 
-	*_box = NULL;
-
 	array_foreach(&box->client->conns, connp) {
 		if ((*connp)->box == box) {
 			(*connp)->box = NULL;
@@ -251,6 +249,10 @@
 		imapc_connection_unselect(box);
 	imapc_msgmap_deinit(&box->msgmap);
 	i_free(box);
+
+	/* set this only after unselect, which may cancel some commands that
+	   reference this box */
+	*_box = NULL;
 }
 
 static void imapc_client_mailbox_cmd_cb(const struct imapc_command_reply *reply,


More information about the dovecot-cvs mailing list