Fix memory leak in splay_delete_tree
Use splay_delete_node to properly decrease counters and release memory.
This commit is contained in:
parent
faef01317b
commit
24cea32efb
1 changed files with 1 additions and 1 deletions
|
@ -544,7 +544,7 @@ void splay_delete(splay_tree_t *tree, void *data) {
|
|||
void splay_delete_tree(splay_tree_t *tree) {
|
||||
for(splay_node_t *node = tree->head, *next; node; node = next) {
|
||||
next = node->next;
|
||||
splay_free_node(tree, node);
|
||||
splay_delete_node(tree, node);
|
||||
}
|
||||
|
||||
splay_free_tree(tree);
|
||||
|
|
Loading…
Reference in a new issue