Skip to content

Commit 9e44b68

Browse files
fix: remove memory leak (#2532)
Co-authored-by: realstealthninja <[email protected]>
1 parent 435f1ed commit 9e44b68

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sorting/library_sort.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ void librarySort(int *index, int n) {
6969
index_pos_for_output++;
7070
}
7171
}
72+
delete[] numbered;
73+
delete[] gaps;
74+
for (int i = 0; i < 2; ++i) {
75+
delete[] library[i];
76+
}
7277
}
7378

7479
int main() {

0 commit comments

Comments
 (0)