changeset 8253:c9b9b551eb3f HEAD

Expire plugin was crashing because of previous change.
author Timo Sirainen <tss@iki.fi>
date Mon, 06 Oct 2008 22:07:23 +0300
parents 533b43760eaa
children c465b10a76fd
files src/plugins/expire/expire-plugin.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/expire/expire-plugin.c	Mon Oct 06 19:24:20 2008 +0300
+++ b/src/plugins/expire/expire-plugin.c	Mon Oct 06 22:07:23 2008 +0300
@@ -99,6 +99,7 @@
 {
 	struct expire_mailbox *xpr_box = EXPIRE_CONTEXT(t->box);
 	struct expire_transaction_context *xt = EXPIRE_CONTEXT(t);
+	struct mailbox *box = t->box;
 	time_t new_stamp;
 	bool update_dict = FALSE;
 	int ret;
@@ -117,13 +118,14 @@
 		i_free(xt);
 		return -1;
 	}
+	/* transaction is freed now */
+	t = NULL;
 
 	if (xt->first_expunged || xt->saves) T_BEGIN {
 		const char *key, *value;
 
 		key = t_strconcat(DICT_EXPIRE_PREFIX, expire.username, "/",
-				  t->box->storage->ns->prefix,
-				  t->box->name, NULL);
+				  box->storage->ns->prefix, box->name, NULL);
 		if (!xt->first_expunged && xt->saves) {
 			/* saved new mails. dict needs to be updated only if
 			   this is the first mail in the database */