Skip to content

Commit

Permalink
fix: remove memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 committed Feb 12, 2024
1 parent 2dadbf7 commit 5d8ac3b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sorting/library_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ void librarySort(int *index, int n) {
index_pos_for_output++;
}
}
delete[] numbered;
delete[] gaps;
for (int i = 0; i < 2; ++i) {
delete[] library[i];
}
}

int main() {
Expand Down

0 comments on commit 5d8ac3b

Please sign in to comment.