From: Timo Sirainen Date: Mon, 26 Dec 2022 21:48:27 +0000 (+0200) Subject: lib-storage: Fix unnecessary data stack growth when iterating mailboxes X-Git-Tag: 2.3.21~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8832f6c00273e5cde645e7e2a1e8cb6f4aed8d1c;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Fix unnecessary data stack growth when iterating mailboxes When listing mailbox list indexes, it was possible that each iteration increased the data stack memory usage. It was all freed at the end though, so this didn't cause any permanent leaks. Broken by 4fdb040d2471c6e5006579bef1dd0586f89c8570 --- diff --git a/src/lib-storage/list/mailbox-list-index-iter.c b/src/lib-storage/list/mailbox-list-index-iter.c index be8b265d36..680808e347 100644 --- a/src/lib-storage/list/mailbox-list-index-iter.c +++ b/src/lib-storage/list/mailbox-list-index-iter.c @@ -160,7 +160,7 @@ mailbox_list_index_update_next(struct mailbox_list_index_iterate_context *ctx, } else { while (node->next == NULL) { node = node->parent; - if (node != NULL) { + if (node != NULL) T_BEGIN { /* The storage name kept in the iteration context is escaped. To calculate the right truncation margin, the length of the name must be @@ -173,7 +173,7 @@ mailbox_list_index_update_next(struct mailbox_list_index_iterate_context *ctx, ctx->parent_len -= str_len(escaped_name); if (node->parent != NULL) ctx->parent_len--; - } + } T_END; if (node == NULL) { /* last one */ ctx->next_node = NULL;