dovecot-2.0: mbox-snarf plugin: Fixed memory/io leaking.

dovecot at dovecot.org dovecot at dovecot.org
Fri May 1 21:54:25 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/2e7503221cb7
changeset: 9197:2e7503221cb7
user:      Timo Sirainen <tss at iki.fi>
date:      Fri May 01 14:53:52 2009 -0400
description:
mbox-snarf plugin: Fixed memory/io leaking.

diffstat:

1 file changed, 10 insertions(+)
src/plugins/mbox-snarf/mbox-snarf-plugin.c |   10 ++++++++++

diffs (27 lines):

diff -r ef0c861608d9 -r 2e7503221cb7 src/plugins/mbox-snarf/mbox-snarf-plugin.c
--- a/src/plugins/mbox-snarf/mbox-snarf-plugin.c	Fri May 01 14:50:08 2009 -0400
+++ b/src/plugins/mbox-snarf/mbox-snarf-plugin.c	Fri May 01 14:53:52 2009 -0400
@@ -127,6 +127,15 @@ mbox_snarf_sync_init(struct mailbox *box
 	return mbox->module_ctx.super.sync_init(box, flags);
 }
 
+static int mbox_snarf_close(struct mailbox *box)
+{
+	struct mbox_snarf_mailbox *mbox = MBOX_SNARF_CONTEXT(box);
+
+	if (mbox->spool_mbox != NULL)
+		mailbox_close(&mbox->spool_mbox);
+	return mbox->module_ctx.super.close(box);
+}
+
 static struct mailbox *
 mbox_snarf_mailbox_open(struct mail_storage *storage, const char *name,
 			struct istream *input, enum mailbox_open_flags flags)
@@ -169,6 +178,7 @@ mbox_snarf_mailbox_open(struct mail_stor
 	mbox->module_ctx.super = box->v;
 
 	box->v.sync_init = mbox_snarf_sync_init;
+	box->v.close = mbox_snarf_close;
 	MODULE_CONTEXT_SET(box, mbox_snarf_storage_module, mbox);
 	return box;
 }


More information about the dovecot-cvs mailing list