From: Marco Bettini Date: Tue, 15 Jul 2025 08:09:09 +0000 (+0000) Subject: lib-storage: Make mailbox_tree_deinit() and mailbox_tree_iterate_deinit() no-ops... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62d014a5e9676c872eb4183c47b3c4c5c622a538;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Make mailbox_tree_deinit() and mailbox_tree_iterate_deinit() no-ops on NULLs --- diff --git a/src/lib-storage/mailbox-tree.c b/src/lib-storage/mailbox-tree.c index 7e292f950c..94945aeae3 100644 --- a/src/lib-storage/mailbox-tree.c +++ b/src/lib-storage/mailbox-tree.c @@ -52,6 +52,8 @@ void mailbox_tree_deinit(struct mailbox_tree_context **_tree) struct mailbox_tree_context *tree = *_tree; *_tree = NULL; + if (tree == NULL) + return; pool_unref(&tree->pool); i_free(tree); } @@ -260,6 +262,8 @@ void mailbox_tree_iterate_deinit(struct mailbox_tree_iterate_context **_ctx) struct mailbox_tree_iterate_context *ctx = *_ctx; *_ctx = NULL; + if (ctx == NULL) + return; str_free(&ctx->path_str); array_free(&ctx->node_path); i_free(ctx);