Browse Source

Busted ghost pointers

Cameron Weinfurt 5 months ago
parent
commit
748cd262c3
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      tree_alloc.c

+ 3
- 0
tree_alloc.c View File

@@ -322,6 +322,9 @@ void remove_node(TreeAlloc **root_ptr, TreeAlloc *node) {
322 322
 		node->left->parent = tmp;
323 323
 	}
324 324
 
325
+  	// Make sure that it doesn't have any tree pointers it shouldn't have.
326
+  	node->parent = node->left = node->right = NULL;
327
+
325 328
 	if (replace && replace->parent == NULL) {
326 329
 #ifdef DEBUG
327 330
       printf("=== PRE-REMOVE-FIXUP ===\n");

Loading…
Cancel
Save