dovecot-1.2: Expire plugin was crashing because of previous change.

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 6 22:07:27 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/c9b9b551eb3f
changeset: 8253:c9b9b551eb3f
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Oct 06 22:07:23 2008 +0300
description:
Expire plugin was crashing because of previous change.

diffstat:

1 file changed, 4 insertions(+), 2 deletions(-)
src/plugins/expire/expire-plugin.c |    6 ++++--

diffs (28 lines):

diff -r 533b43760eaa -r c9b9b551eb3f src/plugins/expire/expire-plugin.c
--- 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 @@ expire_mailbox_transaction_commit(struct
 {
 	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 @@ expire_mailbox_transaction_commit(struct
 		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 */


More information about the dovecot-cvs mailing list