Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9e44b68

Browse files
vil02realstealthninja
andauthored
fix: remove memory leak (TheAlgorithms#2532)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
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)

AltStyle によって変換されたページ (->オリジナル) /