From 6b28eee0756dff0e5dae8d2c1292a0be097706dd Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 8 Apr 2012 00:30:23 +0200 Subject: [PATCH] btr_slice_out_node(): Set parent to NULL. Without this, a subsequent btr_remove_node() on the spliced out node could segfault. --- buffer_tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/buffer_tree.c b/buffer_tree.c index 08892b4b..7d79636f 100644 --- a/buffer_tree.c +++ b/buffer_tree.c @@ -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; } /** -- 2.39.5