dovecot-2.2: mailbox_list_index=yes: Don't crash if destroying l...

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 21 19:30:49 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/3fb9a8bc35aa
changeset: 15883:3fb9a8bc35aa
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 21 19:30:38 2013 +0200
description:
mailbox_list_index=yes: Don't crash if destroying list before its init finished.

diffstat:

 src/lib-storage/list/mailbox-list-index.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (24 lines):

diff -r 5c83eacce0de -r 3fb9a8bc35aa src/lib-storage/list/mailbox-list-index.c
--- a/src/lib-storage/list/mailbox-list-index.c	Thu Feb 21 17:09:08 2013 +0200
+++ b/src/lib-storage/list/mailbox-list-index.c	Thu Feb 21 19:30:38 2013 +0200
@@ -420,12 +420,14 @@
 
 	if (ilist->to_refresh != NULL)
 		timeout_remove(&ilist->to_refresh);
-	hash_table_destroy(&ilist->mailbox_hash);
-	hash_table_destroy(&ilist->mailbox_names);
-	pool_unref(&ilist->mailbox_pool);
-	if (ilist->opened)
-		mail_index_close(ilist->index);
-	mail_index_free(&ilist->index);
+	if (ilist->index != NULL) {
+		hash_table_destroy(&ilist->mailbox_hash);
+		hash_table_destroy(&ilist->mailbox_names);
+		pool_unref(&ilist->mailbox_pool);
+		if (ilist->opened)
+			mail_index_close(ilist->index);
+		mail_index_free(&ilist->index);
+	}
 	ilist->module_ctx.super.deinit(list);
 }
 


More information about the dovecot-cvs mailing list