From: Stephan Bosch Date: Wed, 20 Jun 2018 10:40:37 +0000 (+0200) Subject: lib-storage: fail storage: Allocate event for mailbox. X-Git-Tag: 2.3.4~169 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4fcd4e8fad45dcaa637e4cb36a9f99204d69badf;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: fail storage: Allocate event for mailbox. Absence of event causes segfault when event logging is performed for the mailbox. --- 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;