dovecot-1.2: SEARCH INTREAD: Crashfix when deinitializing.

dovecot at dovecot.org dovecot at dovecot.org
Wed May 20 20:51:16 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/172cfd750a40
changeset: 9063:172cfd750a40
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 694714d59cd9 -r 172cfd750a40 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:
@@ -251,11 +251,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