]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lazy-expunge: Don't crash when using shared users.
authorTimo Sirainen <tss@iki.fi>
Thu, 5 Aug 2010 17:43:23 +0000 (18:43 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 5 Aug 2010 17:43:23 +0000 (18:43 +0100)
src/plugins/lazy-expunge/lazy-expunge-plugin.c

index 218daafd2e98773c180c6c5dc7aebe59c619e19f..79ed88b427876a1d80a7ce87ed567618baf83b55 100644 (file)
@@ -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);
 }