]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: mail_event_create() - Free data stack allocations before returning
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 27 Dec 2022 11:21:30 +0000 (06:21 -0500)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 11 Jan 2023 21:50:37 +0000 (23:50 +0200)
src/lib-storage/mail.c

index 4a532a2edecf4a5c95be9d235324342ce901cf1a..225b358b248d3f102a2ff5c275304f1e4fe6db75 100644 (file)
@@ -137,11 +137,13 @@ void mail_event_create(struct mail *mail)
        if (index_mail_get_age_days(mail, &age_days))
                event_add_int(p->_event, "mail_age_days", age_days);
 
-       char uid_buf[MAX_INT_STRLEN];
-       const char *prefix = t_strconcat(
-               p->mail.saving ? "saving UID " : "UID ",
-               dec2str_buf(uid_buf, p->mail.uid), ": ", NULL);
-       event_set_append_log_prefix(p->_event, prefix);
+       T_BEGIN {
+               char uid_buf[MAX_INT_STRLEN];
+               const char *prefix = t_strconcat(
+                       p->mail.saving ? "saving UID " : "UID ",
+                       dec2str_buf(uid_buf, p->mail.uid), ": ", NULL);
+               event_set_append_log_prefix(p->_event, prefix);
+       } T_END;
 }
 
 struct event *mail_event(struct mail *mail)