changeset 11900:25a1c1739a63

lib-storage: Don't crash in mailbox_transaction_commit() if plugin aborts transaction.
author Timo Sirainen <tss@iki.fi>
date Mon, 26 Jul 2010 19:10:21 +0100
parents 636d34f650c2
children edb8f06c7346
files src/lib-storage/mail-storage.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/mail-storage.c	Fri Jul 23 21:08:55 2010 +0100
+++ b/src/lib-storage/mail-storage.c	Mon Jul 26 19:10:21 2010 +0100
@@ -1175,8 +1175,10 @@
 
 	/* Store changes temporarily so that plugins overriding
 	   transaction_commit() can look at them. */
+	changes.pool = NULL;
 	ret = mailbox_transaction_commit_get_changes(t, &changes);
-	pool_unref(&changes.pool);
+	if (changes.pool != NULL)
+		pool_unref(&changes.pool);
 	return ret;
 }