summaryrefslogtreecommitdiff
path: root/ldpd/lde_lib.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-02-17 19:02:55 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-02-23 07:08:36 -0500
commit55cd0f612a046137f0be936e7856921ada4546ca (patch)
tree33ebc2df612fe462d3f422834fe6c99c409320f1 /ldpd/lde_lib.c
parenta031a7e4c9232fc9433e51af6b67f22d9b0cd663 (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 'ldpd/lde_lib.c')
-rw-r--r--ldpd/lde_lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ldpd/lde_lib.c b/ldpd/lde_lib.c
index 18c8c0a122..28e455c7a5 100644
--- a/ldpd/lde_lib.c
+++ b/ldpd/lde_lib.c
@@ -129,7 +129,9 @@ fec_clear(struct fec_tree *fh, void (*free_cb)(void *))
{
struct fec *f;
- while ((f = RB_ROOT(fec_tree, fh)) != NULL) {
+ while (!RB_EMPTY(fec_tree, fh)) {
+ f = RB_ROOT(fec_tree, fh);
+
fec_remove(fh, f);
free_cb(f);
}