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 <michael.tremer@ipfire.org>
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)
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;