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 ecaf3c9..139d23a 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);