From: Timo Sirainen Date: Thu, 5 Aug 2010 17:43:23 +0000 (+0100) Subject: lazy-expunge: Don't crash when using shared users. X-Git-Tag: 2.0.rc5~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7c8d8416a771681a8b87aa2cbdef3ee0043f004;p=thirdparty%2Fdovecot%2Fcore.git lazy-expunge: Don't crash when using shared users. --- 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); }