From 3836b1a0fbe65fbb3f6b8021e38c28b950ba9a11 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 6 Mar 2025 16:24:46 +0000 Subject: [PATCH] tree: Add network to the stack after we have tried again If we add it before, we will try to merge the network with itself which is not necessary as it will never result in anything good. Signed-off-by: Michael Tremer --- src/network-tree.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/network-tree.c b/src/network-tree.c index 7096625..c2627e3 100644 --- a/src/network-tree.c +++ b/src/network-tree.c @@ -396,11 +396,6 @@ static int loc_network_tree_merge_step(struct loc_network* network, void* data) if (r) goto ERROR; - // Add the new network to the stack - r = loc_network_list_push(ctx->networks, m); - if (r) - goto ERROR; - // Remove the previous network from the stack r = loc_network_list_remove(ctx->networks, n); if (r) @@ -414,6 +409,11 @@ static int loc_network_tree_merge_step(struct loc_network* network, void* data) if (r) goto ERROR; + // Add the new network to the stack + r = loc_network_list_push(ctx->networks, m); + if (r) + goto ERROR; + loc_network_unref(m); m = NULL; -- 2.39.5