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.
This commit is contained in:
parent
de029ce460
commit
5a7fc58012
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue