dovecot-2.0: SEARCH INTREAD: Crashfix when deinitializing.

dovecot at dovecot.org dovecot at dovecot.org
Tue May 19 21:52:18 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/91b961fb07a5
changeset: 9328:91b961fb07a5
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 19 14:48:08 2009 -0400
description:
SEARCH INTREAD: Crashfix when deinitializing.

diffstat:

1 file changed, 6 insertions(+), 3 deletions(-)
src/lib-storage/mail-search.c |    9 ++++++---

diffs (35 lines):

diff -r a9ffb4614b5e -r 91b961fb07a5 src/lib-storage/mail-search.c
--- a/src/lib-storage/mail-search.c	Tue May 19 13:37:31 2009 -0400
+++ b/src/lib-storage/mail-search.c	Tue May 19 14:48:08 2009 -0400
@@ -150,13 +150,13 @@ static void mail_search_args_deinit_sub(
 			break;
 		case SEARCH_INTHREAD:
 			i_assert(arg->value.search_args->refcount > 0);
-			arg->value.search_args->refcount--;
-			arg->value.search_args->box = NULL;
 			if (args->refcount == 0 &&
 			    arg->value.search_result != NULL) {
 				mailbox_search_result_free(
 					&arg->value.search_result);
 			}
+			arg->value.search_args->refcount--;
+			arg->value.search_args->box = NULL;
 			/* fall through */
 		case SEARCH_SUB:
 		case SEARCH_OR:
@@ -250,11 +250,14 @@ mail_search_arg_dup_one(pool_t pool, con
 	new_arg->type = arg->type;
 	new_arg->not = arg->not;
 	new_arg->match_always = arg->match_always;
+	new_arg->value.search_flags = arg->value.search_flags;
 
 	switch (arg->type) {
+	case SEARCH_INTHREAD:
+		new_arg->value.thread_type = arg->value.thread_type;
+		/* fall through */
 	case SEARCH_OR:
 	case SEARCH_SUB:
-	case SEARCH_INTHREAD:
 		new_arg->value.subargs =
 			mail_search_arg_dup(pool, arg->value.subargs);
 		break;


More information about the dovecot-cvs mailing list