From: Timo Sirainen Date: Fri, 17 Nov 2017 18:55:55 +0000 (+0200) Subject: fts-lucene: Fix potential memory leak X-Git-Tag: 2.3.0.rc1~436 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f8e934c62a8bd8e9a912e16b59c5e30993bd173;p=thirdparty%2Fdovecot%2Fcore.git fts-lucene: Fix potential memory leak --- diff --git a/src/plugins/fts-lucene/lucene-wrapper.cc b/src/plugins/fts-lucene/lucene-wrapper.cc index 9d5840d634..68d25c78c7 100644 --- a/src/plugins/fts-lucene/lucene-wrapper.cc +++ b/src/plugins/fts-lucene/lucene-wrapper.cc @@ -1210,13 +1210,13 @@ lucene_add_definite_query(struct lucene_index *index, switch (arg->type) { case SEARCH_TEXT: { - BooleanQuery *bq = _CLNEW BooleanQuery(); Query *q1 = lucene_get_query(index, _T("hdr"), arg); Query *q2 = lucene_get_query(index, _T("body"), arg); if (q1 == NULL && q2 == NULL) q = NULL; else { + BooleanQuery *bq = _CLNEW BooleanQuery(); if (q1 != NULL) bq->add(q1, true, BooleanClause::SHOULD); if (q2 != NULL)