Skip to content

Commit

Permalink
Merge pull request #23 from Garz4/main
Browse files Browse the repository at this point in the history
Missed memory leak
  • Loading branch information
urielgarciarivas authored Dec 4, 2023
2 parents 48a50f9 + e4cc5eb commit 25d77af
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions DataStructures/src/sort_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ exist_in_sort_set(const sort_set*const set, int target) {

void
delete_sort_set(sort_set* set) {
if (set == NULL || set->root == NULL) {
if (set == NULL) {
return;
}
/*
sort_set_node* node;
sort_set_node* left;
sort_set_node* right;
*/

if (set->root != NULL) {
DEALLOCATE(set->root);
}

DEALLOCATE(set);
}

0 comments on commit 25d77af

Please sign in to comment.