btr_slice_out_node(): Set parent to NULL.
authorAndre Noll <maan@systemlinux.org>
Sat, 7 Apr 2012 22:30:23 +0000 (00:30 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 9 Apr 2012 20:13:05 +0000 (22:13 +0200)
Without this, a subsequent btr_remove_node() on the spliced
out node could segfault.

buffer_tree.c

index 08892b4..7d79636 100644 (file)
@@ -825,6 +825,7 @@ void btr_splice_out_node(struct btr_node *btrn)
                        list_move(&ch->node, &btrn->parent->children);
        }
        assert(list_empty(&btrn->children));
+       btrn->parent = NULL;
 }
 
 /**