From 7705c6409e5514c939afb992763a44e90354797e Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Wed, 10 Mar 2021 18:10:10 +0000 Subject: [PATCH] Fix some nominal memory leaks --- main/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main/main.cpp b/main/main.cpp index f22383e..4209970 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -628,9 +628,17 @@ int main(int argc, char **argv) } } + delete[] fbuf; + + for (size_t i = 0; i < channels; ++i) delete[] ibuf[i]; + delete[] ibuf; + sf_close(sndfile); sf_close(sndfileOut); + free(fileName); + free(fileNameOut); + if (!quiet) { cerr << "in: " << countIn << ", out: " << countOut << ", ratio: " << float(countOut)/float(countIn) << ", ideal output: " << lrint(countIn * ratio) << ", error: " << abs(lrint(countIn * ratio) - int(countOut)) << endl; @@ -656,7 +664,7 @@ int main(int argc, char **argv) } RubberBand::Profiler::dump(); - + return 0; }