From: Timo Sirainen Date: Tue, 21 Sep 2021 13:42:39 +0000 (+0300) Subject: lib-index: Don't use data stack for building index header update buffer X-Git-Tag: 2.3.17~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb75bc110f36189bf89aafea049142a9b9221eed;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Don't use data stack for building index header update buffer The header update can be large (e.g. dovecot.list.index with many mailboxes) and grow data stack unnecessarily. --- diff --git a/src/lib-index/mail-index-transaction-export.c b/src/lib-index/mail-index-transaction-export.c index 4f903cf8e7..2aced679a3 100644 --- a/src/lib-index/mail-index-transaction-export.c +++ b/src/lib-index/mail-index-transaction-export.c @@ -206,7 +206,7 @@ log_append_ext_hdr_update(struct mail_index_export_context *ctx, data = hdr->data; mask = hdr->mask; - buf = t_buffer_create(256); + buf = buffer_create_dynamic(default_pool, 256); for (offset = 0; offset <= hdr->alloc_size; offset++) { if (offset < hdr->alloc_size && mask[offset] != 0) { if (!started) { @@ -233,6 +233,7 @@ log_append_ext_hdr_update(struct mail_index_export_context *ctx, buffer_append_zero(buf, 4 - buf->used % 4); log_append_buffer(ctx, buf, use_32 ? MAIL_TRANSACTION_EXT_HDR_UPDATE32 : MAIL_TRANSACTION_EXT_HDR_UPDATE); + buffer_free(&buf); } static void