From 92df36a610421ed5fcae90e832f64e3acfb7d431 Mon Sep 17 00:00:00 2001 From: thorkill Date: Sat, 4 Jul 2015 02:39:12 +0200 Subject: [PATCH] Cleanup edges stored in edge_weight_tree on exit protocol_edge.c: 131 defines local_address using str2sockaddr str2sockaddr() allocates memory which has to be freed on exit. --- src/edge.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/edge.c b/src/edge.c index 2eaae5d..6539630 100644 --- a/src/edge.c +++ b/src/edge.c @@ -64,6 +64,12 @@ void free_edge_tree(splay_tree_t *edge_tree) { } void exit_edges(void) { + // since edge_weight_tree does not have delete action defined + // we have to cleanup it on exit + for splay_each(edge_t, e, edge_weight_tree) { + sockaddrfree(&e->address); + sockaddrfree(&e->local_address); + } splay_delete_tree(edge_weight_tree); } -- 2.25.1