changeset 9007:66b6cd495702 HEAD

mbox-snarf plugin: Fixed memory/io leaking.
author Timo Sirainen <tss@iki.fi>
date Fri, 01 May 2009 14:53:52 -0400
parents 06bd1266f0c7
children fc4f65a4ca60
files src/plugins/mbox-snarf/mbox-snarf-plugin.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
@@ -126,6 +126,15 @@
 	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->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;
 }