Browse Source

Fixed segfaults on lines 178 and 176

tree_alloc
Cameron Weinfurt 1 year ago
parent
commit
5d216ff450
  1. 4
      tree_alloc.c

4
tree_alloc.c

@ -169,7 +169,7 @@ void replace_node(TreeAlloc **root_ptr, TreeAlloc *node, TreeAlloc *replace) {
else
node->parent->right = replace;
}
if (!replace) replace->parent = node->parent;
if (replace) replace->parent = node->parent;
}
void repair_after_remove(TreeAlloc **root_ptr, TreeAlloc *node) {
@ -242,7 +242,7 @@ void remove_node(TreeAlloc **root_ptr, TreeAlloc *node) {
node->left->parent = tmp;
}
if (do_repair) {
if (do_repair && replace) {
repair_after_remove(root_ptr, replace);
}
}

Loading…
Cancel
Save