dovecot-1.2: mail_search_args_deinit(): Always deinitialize, eve...

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 9 01:30:11 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/99ecc7f748a8
changeset: 8932:99ecc7f748a8
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Apr 08 18:30:06 2009 -0400
description:
mail_search_args_deinit(): Always deinitialize, even when there are extra references.
This fixes at least a crash with virtual mailboxes where the same same args
may be referenced for multiple mailboxes.

diffstat:

1 file changed, 2 insertions(+), 1 deletion(-)
src/lib-storage/mail-search.c |    3 ++-

diffs (20 lines):

diff -r e5633843c336 -r 99ecc7f748a8 src/lib-storage/mail-search.c
--- a/src/lib-storage/mail-search.c	Wed Apr 08 18:17:02 2009 -0400
+++ b/src/lib-storage/mail-search.c	Wed Apr 08 18:30:06 2009 -0400
@@ -126,6 +126,7 @@ void mail_search_args_init(struct mail_s
 		i_assert(args->box == box);
 		return;
 	}
+	args->initialized = TRUE;
 
 	args->box = box;
 	if (!args->simplified)
@@ -167,7 +168,7 @@ static void mail_search_args_deinit_sub(
 
 void mail_search_args_deinit(struct mail_search_args *args)
 {
-	if (args->refcount > 1 || !args->initialized)
+	if (!args->initialized)
 		return;
 
 	mail_search_args_deinit_sub(args, args->args);


More information about the dovecot-cvs mailing list