]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: index_mail_get_raw_headers() - Don't use data stack for allocations
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 27 Dec 2022 11:28:14 +0000 (13:28 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 11 Jan 2023 21:50:37 +0000 (23:50 +0200)
For some reason this was changed to data stack allocation in
53712af0e7f357e7279d9ff03831428aae85aa45. It looks accidental, since the
change wasn't described in the commit message. This didn't actually cause
any problems, since the callers duplicated the allocations from data_pool.

src/lib-storage/index/index-mail-headers.c

index 4c7bcdd8d99a934fcbc5401124665ae34c746251..1423c54147f2778b0ed10882ba69ca7545af19cb 100644 (file)
@@ -670,7 +670,7 @@ index_mail_get_raw_headers(struct index_mail *mail, const char *field,
 
        field_idx = get_header_field_idx(_mail->box, field);
 
-       dest = t_str_new(128);
+       dest = str_new(mail->mail.data_pool, 128);
        if (mail_cache_lookup_headers(_mail->transaction->cache_view, dest,
                                      _mail->seq, &field_idx, 1) <= 0) {
                /* not in cache / error - first see if it's already parsed */