From: Timo Sirainen Date: Wed, 18 Mar 2015 11:43:35 +0000 (+0200) Subject: fts: Fixed assert-crash if fts-parser was created for a body part that backend didn... X-Git-Tag: 2.2.17.rc1~256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70fc76bbc5b4e57168c2b75a97d26edc1886ef36;p=thirdparty%2Fdovecot%2Fcore.git fts: Fixed assert-crash if fts-parser was created for a body part that backend didn't want to index. --- diff --git a/src/plugins/fts/fts-build-mail.c b/src/plugins/fts/fts-build-mail.c index 02f1d2fb4d..a8a09289e9 100644 --- a/src/plugins/fts/fts-build-mail.c +++ b/src/plugins/fts/fts-build-mail.c @@ -184,7 +184,12 @@ fts_build_body_begin(struct fts_mail_build_context *ctx, } key.body_content_type = content_type; key.body_content_disposition = ctx->content_disposition; - return fts_backend_update_set_build_key(ctx->update_ctx, &key); + if (!fts_backend_update_set_build_key(ctx->update_ctx, &key)) { + if (ctx->body_parser != NULL) + (void)fts_parser_deinit(&ctx->body_parser); + return FALSE; + } + return TRUE; } static int fts_build_body_block(struct fts_mail_build_context *ctx,