From d4b7b491099cc9633422dad6687a94392faeece1 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Wed, 7 Dec 2011 22:24:33 +0100 Subject: Fix a memory leak. --- bitmapped_patricia_tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bitmapped_patricia_tree.c b/bitmapped_patricia_tree.c index 765b817..42985c5 100644 --- a/bitmapped_patricia_tree.c +++ b/bitmapped_patricia_tree.c @@ -249,7 +249,8 @@ bpt_t bpt_assoc(bpt_t bpt, bpt_key_t key, void *value) { memcpy(new_node->children, b->children, size_of_child_array); new_node->children[child_index] = new_child; // Retain the children copied into the new node. - bpt_for_children(bpt, bpt_retain); + bpt_for_children((bpt_t)new_node, bpt_retain); + bpt_release(new_child); return (bpt_t)new_node; } } -- cgit v1.2.3