From f3bed8816ef2842845b8bf1714a9458dd47460d0 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 1 Aug 2012 22:43:45 +0300 Subject: [PATCH] fts: Fixed a crash if virtual mailbox search couldn't be optimized by backend. --- src/plugins/fts/fts-api.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/fts/fts-api.c b/src/plugins/fts/fts-api.c index 079b2f9388..818c0ca40e 100644 --- a/src/plugins/fts/fts-api.c +++ b/src/plugins/fts/fts-api.c @@ -323,8 +323,14 @@ int fts_backend_lookup_multi(struct fts_backend *backend, i_assert(boxes[0] != NULL); if (backend->v.lookup_multi != NULL) { - return backend->v.lookup_multi(backend, boxes, args, - and_args, result); + if (backend->v.lookup_multi(backend, boxes, args, + and_args, result) < 0) + return -1; + if (result->box_results == NULL) { + result->box_results = p_new(result->pool, + struct fts_result, 1); + } + return 0; } for (i = 0; boxes[i] != NULL; i++) ; -- 2.47.3