From 5a7fc58012da10b96073804994777255463d1b8d Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 8 Sep 2009 16:35:28 +0200 Subject: [PATCH] Always remove a node from the UDP tree before freeing it. Valgrind caught tinc reading free'd memory during a purge(). This was caused by first removing it from the main node tree, which will already call free_node(), and then removing it from the UDP tree. This might cause spurious segmentation faults. --- src/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.c b/src/node.c index a4ef78f2..f2bb3990 100644 --- a/src/node.c +++ b/src/node.c @@ -137,8 +137,8 @@ void node_del(node_t *n) edge_del(e); } - avl_delete(node_tree, n); avl_delete(node_udp_tree, n); + avl_delete(node_tree, n); } node_t *lookup_node(char *name) -- 2.39.5