diff --git a/Include/Fledasty/Trees/BinarySearchTree.h b/Include/Fledasty/Trees/BinarySearchTree.h index 2bbf315..369a691 100644 --- a/Include/Fledasty/Trees/BinarySearchTree.h +++ b/Include/Fledasty/Trees/BinarySearchTree.h @@ -114,6 +114,7 @@ FledastyError fledasty_binary_search_tree_##name##_insert(FledastyBinarySearchTr while (new_node->parent == NULL) { \ if (compare_key_function(key, current_node->key)) { \ current_node->value = value; \ + hallocy_free(new_node); \ return FLEDASTY_ERROR_VALUE_REPLACED; \ } \ \