From: Ronnie Sahlberg Date: Wed, 25 Jul 2007 07:22:04 +0000 (+1000) Subject: if sibling is NULL it is a leaf node and thus black. X-Git-Tag: tevent-0.9.20~348^2~2445^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=904e5ba55e5a8f613e47666e7ea63af4fb97eed2;p=thirdparty%2Fsamba.git if sibling is NULL it is a leaf node and thus black. (This used to be ctdb commit 400488472ba64514fa6534d5de90edba6c5e27c6) --- diff --git a/ctdb/common/rb_tree.c b/ctdb/common/rb_tree.c index acc175b965d..8acc983ceb8 100644 --- a/ctdb/common/rb_tree.c +++ b/ctdb/common/rb_tree.c @@ -328,7 +328,8 @@ trbt_delete_case2(trbt_node_t *node) trbt_node_t *sibling; sibling = trbt_sibling(node); - if (sibling->rb_color == TRBT_RED) { + /* If there is no sibling it is a leaf and thus black */ + if (sibling && sibling->rb_color == TRBT_RED) { if (node == node->parent->left) { trbt_rotate_left(node->parent); } else { @@ -590,4 +591,4 @@ test_tree(void) } } -#endif \ No newline at end of file +#endif