]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
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 08892b4b4b4b31b8985f58d707197bc527987435..7d79636fac717f4e4cb8559dec698f8204eed34c 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;
 }
 
 /**