From: Guus Sliepen Date: Tue, 8 Sep 2009 14:35:28 +0000 (+0200) Subject: Always remove a node from the UDP tree before freeing it. X-Git-Tag: release-1.0.10~48 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=5a7fc58012da10b96073804994777255463d1b8d;p=tinc 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. --- 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)