Code

c_avl_pick needs to update the 'size' field of the tree when it deletes
authorCorey Kosak <kosak@google.com>
Wed, 25 Nov 2015 21:54:30 +0000 (16:54 -0500)
committerFlorian Forster <octo@collectd.org>
Thu, 26 Nov 2015 13:22:05 +0000 (14:22 +0100)
a node.

Signed-off-by: Florian Forster <octo@collectd.org>
src/utils_avltree.c

index ecaf3c915967b2daee20489b9d8aa02aa41e6de6..139d23ace3da91ad5debb7c4278052b1d6aa572b 100644 (file)
@@ -648,6 +648,7 @@ int c_avl_pick (c_avl_tree_t *t, void **key, void **value)
        *value = n->value;
 
        free_node (n);
+       --t->size;
        rebalance (t, p);
 
        return (0);