From 67b44e99ce55e2f50d17b8156d6c0a9960cd18e2 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 26 Dec 2022 23:48:27 +0200 Subject: [PATCH] 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 --- src/lib-storage/list/mailbox-list-index-iter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib-storage/list/mailbox-list-index-iter.c b/src/lib-storage/list/mailbox-list-index-iter.c index e061069744..c47732d166 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; -- 2.47.3