diff options
author | Rafael Zalamena <rzalamena@gmail.com> | 2017-06-16 16:08:43 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@gmail.com> | 2017-06-16 16:08:43 +0200 |
commit | 8f942af9026f306e2eeca322b019e2c3c17d8000 (patch) | |
tree | 13f678035343acb4baaae0e9ade1ae52531c94e3 /lib/openbsd-tree.c | |
parent | lib: improve the RB implementation (diff) | |
download | frr-8f942af9026f306e2eeca322b019e2c3c17d8000.tar.xz frr-8f942af9026f306e2eeca322b019e2c3c17d8000.zip |
lib: fix a possible NULL deference
Silences a warning generated by clang.
Diffstat (limited to 'lib/openbsd-tree.c')
-rw-r--r-- | lib/openbsd-tree.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/openbsd-tree.c b/lib/openbsd-tree.c index 37762abc1..9f17f2946 100644 --- a/lib/openbsd-tree.c +++ b/lib/openbsd-tree.c @@ -222,6 +222,10 @@ rbe_remove_color(const struct rb_type *t, struct rb_tree *rbt, { struct rb_entry *tmp; + /* Silence clang possible NULL deference warning. */ + if (parent == NULL) + return; + while ((rbe == NULL || RBE_COLOR(rbe) == RB_BLACK) && rbe != RBH_ROOT(rbt)) { if (RBE_LEFT(parent) == rbe) { |