dovecot-2.2: fts: Error logging fix.

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 2 16:54:59 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/f61345596ce6
changeset: 18793:f61345596ce6
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 02 19:52:15 2015 +0300
description:
fts: Error logging fix.
1) We were logging the error after it was already freed from data stack.
2) We were logging uninitialized error string when fts indexing was the one
that failed.

diffstat:

 src/plugins/fts/fts-build-mail.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 77575024f874 -r f61345596ce6 src/plugins/fts/fts-build-mail.c
--- a/src/plugins/fts/fts-build-mail.c	Tue Jun 02 02:39:20 2015 +0300
+++ b/src/plugins/fts/fts-build-mail.c	Tue Jun 02 19:52:15 2015 +0300
@@ -273,6 +273,8 @@
 		ret = ret2 = fts_tokenizer_next(tokenizer, data, size, &token, &error);
 		if (ret2 > 0 && filter != NULL)
 			ret2 = fts_filter_filter(filter, &token, &error);
+		if (ret2 < 0)
+			i_error("fts: Couldn't create indexable tokens: %s", error);
 		if (ret2 > 0) {
 			if (fts_backend_update_build_more(ctx->update_ctx,
 							  (const void *)token,
@@ -280,8 +282,6 @@
 				ret = -1;
 		}
 	} T_END;
-	if (ret < 0)
-		i_error("fts: Couldn't create indexable tokens: %s", error);
 	return ret;
 }
 


More information about the dovecot-cvs mailing list