From 4a769606eb49926c6dfb9a532186e9e737683283 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 21 Mar 2016 22:10:08 +0900 Subject: [PATCH] lazy-expunge: Fixed crash if lazy_expunge-namespace was not found. --- src/plugins/lazy-expunge/lazy-expunge-plugin.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/lazy-expunge/lazy-expunge-plugin.c b/src/plugins/lazy-expunge/lazy-expunge-plugin.c index 053f25182b..260c6301bf 100644 --- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c +++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c @@ -445,8 +445,10 @@ lazy_expunge_mail_namespaces_created(struct mail_namespace *namespaces) /* see if it's set to namespace root itself. in that case we store all the expunged mails to the namespace root. */ luser->lazy_ns = mail_namespace_find_prefix_nosep(namespaces, luser->env); - luser->lazy_mailbox_vname = p_strndup(namespaces->user->pool, - luser->lazy_ns->prefix, luser->lazy_ns->prefix_len-1); + if (luser->lazy_ns != NULL) { + luser->lazy_mailbox_vname = p_strndup(namespaces->user->pool, + luser->lazy_ns->prefix, luser->lazy_ns->prefix_len-1); + } } if (luser->lazy_ns == NULL) i_fatal("lazy_expunge: Unknown namespace: '%s'", luser->env);