From bce177767d521b47efd458c5cd570959a98d940d Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 26 Jun 2012 14:22:57 +0200 Subject: [PATCH] Fix crash when handling the ALRM signal. In retry() the function do_outgoing_connection() is called, which can delete items from the connection_tree, so when walking the tree we must first save the pointer to the next item. --- src/net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/net.c b/src/net.c index 295546df..863dd762 100644 --- a/src/net.c +++ b/src/net.c @@ -341,9 +341,10 @@ int reload_configuration(void) { void retry(void) { connection_t *c; - splay_node_t *node; + splay_node_t *node, *next; - for(node = connection_tree->head; node; node = node->next) { + for(node = connection_tree->head; node; node = next) { + next = node->next; c = node->data; if(c->outgoing && !c->node) { -- 2.20.1