diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-17 19:02:55 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-23 07:08:36 -0500 |
| commit | 55cd0f612a046137f0be936e7856921ada4546ca (patch) | |
| tree | 33ebc2df612fe462d3f422834fe6c99c409320f1 /lib/ns.c | |
| parent | a031a7e4c9232fc9433e51af6b67f22d9b0cd663 (diff) | |
*: 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 <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/ns.c')
| -rw-r--r-- | lib/ns.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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. */ |
