From b7c8d8416a771681a8b87aa2cbdef3ee0043f004 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 5 Aug 2010 18:43:23 +0100 Subject: [PATCH] lazy-expunge: Don't crash when using shared users. --- 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 218daafd2e..79ed88b427 100644 --- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c +++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c @@ -558,8 +558,10 @@ static void lazy_expunge_user_deinit(struct mail_user *user) struct lazy_expunge_mail_user *luser = LAZY_EXPUNGE_USER_CONTEXT(user); unsigned int i; - for (i = 0; i < LAZY_NAMESPACE_COUNT; i++) - mail_namespace_unref(&luser->lazy_ns[i]); + for (i = 0; i < LAZY_NAMESPACE_COUNT; i++) { + if (luser->lazy_ns[i] != NULL) + mail_namespace_unref(&luser->lazy_ns[i]); + } luser->module_ctx.super.deinit(user); } -- 2.47.3