From c7d4b98870d1bbcfd97f04611253ff743a6a7cff Mon Sep 17 00:00:00 2001 From: Frederik Van Slycken Date: Fri, 3 Feb 2017 18:43:50 +0100 Subject: [PATCH] radio_mgr signal handler : safe cleanup --- modules/pico_dev_radio_mgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/pico_dev_radio_mgr.c b/modules/pico_dev_radio_mgr.c index f299ffdfe..162caed6f 100644 --- a/modules/pico_dev_radio_mgr.c +++ b/modules/pico_dev_radio_mgr.c @@ -310,12 +310,12 @@ pico_radio_mgr_process(struct pollfd *fds, int n) static void pico_radio_mgr_quit(int signum) { - struct pico_tree_node *i = NULL; + struct pico_tree_node *i = NULL, *tmp = NULL; struct socket *key = NULL; IGNORE_PARAMETER(signum); dbg("Closing all sockets..."); - pico_tree_foreach(i, &Sockets) { + pico_tree_foreach_safe(i, &Sockets, tmp) { key = i->keyValue; if (key) { pico_tree_delete(&Sockets, key);