]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fixed doing multiple changes via mailbox_attribute_set/unset()
authorTimo Sirainen <tss@iki.fi>
Sun, 19 Jul 2015 07:57:26 +0000 (10:57 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 19 Jul 2015 07:57:26 +0000 (10:57 +0300)
Only the last change was committed and the earlier changes were just leaking
memory.

src/lib-storage/index/index-attribute.c

index 321b6fbcd290d48214734f4a426220db616f8e00..2465fbd3f5320870657a4cac56cd1193ea0c72e0 100644 (file)
@@ -170,6 +170,12 @@ index_storage_attribute_get_dict_trans(struct mailbox_transaction_context *t,
        }
        i_assert(dtransp != NULL);
 
+       if (*dtransp != NULL) {
+               /* transaction already created */
+               *dtrans_r = *dtransp;
+               return 0;
+       }
+
        if (index_storage_get_dict(t->box, type, &dict, mailbox_prefix_r) < 0)
                return -1;
        *dtransp = *dtrans_r = dict_transaction_begin(dict);