]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
if sibling is NULL it is a leaf node and thus black.
authorRonnie Sahlberg <sahlberg@ronnie>
Wed, 25 Jul 2007 07:22:04 +0000 (17:22 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Wed, 25 Jul 2007 07:22:04 +0000 (17:22 +1000)
(This used to be ctdb commit 400488472ba64514fa6534d5de90edba6c5e27c6)

ctdb/common/rb_tree.c

index acc175b965d88399049d56150d194d6cf8619221..8acc983ceb857ce6a748257bec78732a8e1654f0 100644 (file)
@@ -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