Set a node's pointers to zero before trying to insert it into a tree.

This commit is contained in:
Guus Sliepen 2012-12-03 09:02:08 +01:00
parent d2b19be1a0
commit d19b006065

View file

@ -398,6 +398,8 @@ splay_node_t *splay_insert_node(splay_tree_t *tree, splay_node_t *node) {
splay_node_t *closest;
int result;
node->left = node->right = node->parent = node->next = node->prev = NULL;
if(!tree->root)
splay_insert_top(tree, node);
else {