From 771c923ba3d6e2122d822cd1ebd38373020dc422 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 4 Oct 2019 21:08:59 +0200 Subject: [PATCH] Fix potential memory leaks in the autoconnect algorithm. --- src/net.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/net.c b/src/net.c index c3937307..1e2e00cd 100644 --- a/src/net.c +++ b/src/net.c @@ -421,7 +421,7 @@ static void periodic_handler(event_loop_t *loop, void *data) { logger(mesh, MESHLINK_DEBUG, "* could not find node for initial connect"); } - splay_free_tree(nodes); + splay_delete_tree(nodes); } @@ -450,11 +450,11 @@ static void periodic_handler(event_loop_t *loop, void *data) { logger(mesh, MESHLINK_DEBUG, "* found better node"); connect_to = (node_t *)nodes->head->data; - splay_free_tree(nodes); + splay_delete_tree(nodes); break; } - splay_free_tree(nodes); + splay_delete_tree(nodes); } else { break; } @@ -484,7 +484,7 @@ static void periodic_handler(event_loop_t *loop, void *data) { logger(mesh, MESHLINK_DEBUG, "* could not find nodes for partition healing"); } - splay_free_tree(nodes); + splay_delete_tree(nodes); } @@ -546,7 +546,7 @@ static void periodic_handler(event_loop_t *loop, void *data) { disconnect_from = (node_t *)nodes->head->data; } - splay_free_tree(nodes); + splay_delete_tree(nodes); break; } } @@ -577,7 +577,7 @@ static void periodic_handler(event_loop_t *loop, void *data) { logger(mesh, MESHLINK_DEBUG, "* no node we want to disconnect, even though we have too many connections"); } - splay_free_tree(nodes); + splay_delete_tree(nodes); } -- 2.39.5