From b74c00eb01757b6484f730d2f5084f64ae1253eb Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Wed, 20 Jun 2018 12:40:37 +0200 Subject: [PATCH] lib-storage: fail storage: Allocate event for mailbox. Absence of event causes segfault when event logging is performed for the mailbox. --- src/lib-storage/fail-mailbox.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib-storage/fail-mailbox.c b/src/lib-storage/fail-mailbox.c index 175cf2bd20..1b79b24080 100644 --- a/src/lib-storage/fail-mailbox.c +++ b/src/lib-storage/fail-mailbox.c @@ -39,8 +39,9 @@ static void fail_mailbox_close(struct mailbox *box ATTR_UNUSED) { } -static void fail_mailbox_free(struct mailbox *box ATTR_UNUSED) +static void fail_mailbox_free(struct mailbox *box) { + event_unref(&box->event); } static int @@ -322,6 +323,12 @@ fail_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list, box->pool = pool; box->flags = flags; + box->event = event_create(box->storage->event); + event_add_category(box->event, &event_category_mailbox); + event_add_str(box->event, "name", box->vname); + event_set_append_log_prefix(box->event, + t_strdup_printf("Mailbox %s: ", box->vname)); + p_array_init(&box->search_results, pool, 16); p_array_init(&box->module_contexts, pool, 5); return box; -- 2.47.3