dovecot-2.0: virtual: wanted_headers needs to be kept referenced.
dovecot at dovecot.org
dovecot at dovecot.org
Tue Jan 19 16:52:28 EET 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/45f360c1c9eb
changeset: 10563:45f360c1c9eb
user: Timo Sirainen <tss at iki.fi>
date: Tue Jan 19 16:52:19 2010 +0200
description:
virtual: wanted_headers needs to be kept referenced.
diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
src/plugins/virtual/virtual-mail.c | 9 ++++++++-
diffs (26 lines):
diff -r 57eb71a78375 -r 45f360c1c9eb src/plugins/virtual/virtual-mail.c
--- a/src/plugins/virtual/virtual-mail.c Tue Jan 19 16:51:47 2010 +0200
+++ b/src/plugins/virtual/virtual-mail.c Tue Jan 19 16:52:19 2010 +0200
@@ -45,7 +45,11 @@ virtual_mail_alloc(struct mailbox_transa
vmail->imail.trans = (struct index_transaction_context *)t;
vmail->wanted_fields = wanted_fields;
- vmail->wanted_headers = wanted_headers;
+ if (wanted_headers != NULL) {
+ vmail->wanted_headers = wanted_headers;
+ mailbox_header_lookup_ref(wanted_headers);
+ }
+
i_array_init(&vmail->backend_mails, array_count(&mbox->backend_boxes));
return &vmail->imail.mail.mail;
}
@@ -60,6 +64,9 @@ static void virtual_mail_free(struct mai
for (i = 0; i < count; i++)
mail_free(&mails[i]);
array_free(&vmail->backend_mails);
+
+ if (vmail->wanted_headers != NULL)
+ mailbox_header_lookup_unref(&vmail->wanted_headers);
pool_unref(&vmail->imail.data_pool);
pool_unref(&vmail->imail.mail.pool);
More information about the dovecot-cvs
mailing list