From 55cd0f612a046137f0be936e7856921ada4546ca Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 17 Feb 2018 19:02:55 -0500 Subject: *: Make assignment from RB_ROOT in while loop work better Fix up the assignment of the variable = RB_ROOT inside of while loop patter we were using. Signed-off-by: Donald Sharp --- lib/ns.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/ns.c') diff --git a/lib/ns.c b/lib/ns.c index fdf93d0742..0b2a3bec78 100644 --- a/lib/ns.c +++ b/lib/ns.c @@ -424,8 +424,11 @@ void ns_terminate(void) { struct ns *ns; - while ((ns = RB_ROOT(ns_head, &ns_tree)) != NULL) + while (!RB_EMPTY(ns_head, &ns_tree)) { + ns = RB_ROOT(ns_head, &ns_tree); + ns_delete(ns); + } } /* Create a socket for the NS. */ -- cgit v1.2.3