diff --git a/sorting/library_sort.cpp b/sorting/library_sort.cpp index c9cba88d8c4..33f151b296d 100644 --- a/sorting/library_sort.cpp +++ b/sorting/library_sort.cpp @@ -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() {