Fix some nominal memory leaks

This commit is contained in:
Chris Cannam
2021-03-10 18:10:10 +00:00
parent 5897dfbc5b
commit 7705c6409e

View File

@@ -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(sndfile);
sf_close(sndfileOut); sf_close(sndfileOut);
free(fileName);
free(fileNameOut);
if (!quiet) { 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; 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(); RubberBand::Profiler::dump();
return 0; return 0;
} }