]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lazy-expunge: Avoid crashing if user init fails.
authorTimo Sirainen <tss@iki.fi>
Tue, 16 Aug 2011 16:51:28 +0000 (19:51 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 16 Aug 2011 16:51:28 +0000 (19:51 +0300)
src/plugins/lazy-expunge/lazy-expunge-plugin.c

index 96f5b5a5a2e74005291df22927e9ab5d7a07fdc2..3d46a71c52b7c7140cc03b1d6aab7d652699955c 100644 (file)
@@ -321,7 +321,9 @@ static void lazy_expunge_user_deinit(struct mail_user *user)
 {
        struct lazy_expunge_mail_user *luser = LAZY_EXPUNGE_USER_CONTEXT(user);
 
-       mail_namespace_unref(&luser->lazy_ns);
+       /* mail_namespaces_created hook isn't necessarily ever called */
+       if (luser->lazy_ns != NULL)
+               mail_namespace_unref(&luser->lazy_ns);
        luser->module_ctx.super.deinit(user);
 }