Don't try to add a non-existing node back to the node_udp_tree.
[oweals/tinc.git] / src / graph.c
index f6ce90dea8605f5af9995e5e73574cc67ab82987..491a59f6323790057bdef04ff49dee02d400a07b 100644 (file)
@@ -226,7 +226,9 @@ void sssp_bfs(void)
                                        free(e->to->hostname);
 
                                e->to->hostname = sockaddr2hostname(&e->to->address);
                                        free(e->to->hostname);
 
                                e->to->hostname = sockaddr2hostname(&e->to->address);
-                               avl_insert_node(node_udp_tree, node);
+
+                               if(node)
+                                       avl_insert_node(node_udp_tree, node);
 
                                if(e->to->options & OPTION_PMTU_DISCOVERY) {
                                        e->to->mtuprobes = 0;
 
                                if(e->to->options & OPTION_PMTU_DISCOVERY) {
                                        e->to->mtuprobes = 0;