Commit
8f942af90 introduced a bug while silencing a clang warning. Silence
the warning in a different way to fix our red-black tree implementation.
Fixes #841.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
{
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)) {
+ rbe != RBH_ROOT(rbt) && parent) {
if (RBE_LEFT(parent) == rbe) {
tmp = RBE_RIGHT(parent);
if (RBE_COLOR(tmp) == RB_RED) {