From: Not Zed Date: Tue, 23 Jul 2024 09:23:01 +0000 (+0930) Subject: Initialise both links for new node. Caught with valgrind. X-Git-Url: https://code.zedzone.au/cvs?a=commitdiff_plain;h=fbddbf36a2d15903547055bee3fb8cd747ee96dc;p=libeze Initialise both links for new node. Caught with valgrind. --- diff --git a/ez-tree.c b/ez-tree.c index 6fcfb08..04a3529 100644 --- a/ez-tree.c +++ b/ez-tree.c @@ -285,8 +285,9 @@ void *ez_tree_put(ez_tree *tree, void *node) { struct ez_tree_scan_info *sp = stack, *se = sp + EZ_TREE_MAX_DEPTH - 1; ez_cmp_fn node_cmp = tree->node_cmp; + // Initialise incoming node k->link[0] = BALANCE0; // balance=0 - node_set_link(k, 1, 0); + k->link[1] = BALANCE0; if (!tree->root.link[1]) { tree->root.link[1] = (intptr_t)k;