From ebd2d7773f2531bd5dddb97c061ddb74af117844 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Thu, 20 Sep 2018 14:20:16 +0100 Subject: [PATCH] [radix-tree] Fix bug in _degrade_to_n16 Values were getting shuffled --- base/data-struct/radix-tree-adaptive.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base/data-struct/radix-tree-adaptive.c b/base/data-struct/radix-tree-adaptive.c index a657b2bac..23e69f842 100644 --- a/base/data-struct/radix-tree-adaptive.c +++ b/base/data-struct/radix-tree-adaptive.c @@ -581,12 +581,11 @@ static void _degrade_to_n16(struct node48 *n48, struct value *result) for (i = 0; i < 256; i++) { if (n48->keys[i] < 48) { n16->keys[count] = i; + n16->values[count] = n48->values[n48->keys[i]]; count++; } } - memcpy(n16->values, n48->values, n48->nr_entries * sizeof(*n16->values)); - free(n48); result->type = NODE16;