cppcheck: miniflann.cpp, resource leak (Bug #1658)
Description
cppcheck reports a resource leak at line 647 in miniflan.cpp because fclose(fout) is not called before the return, it should be
void Index::save(const std::string& filename) const
{
FILE* fout = fopen(filename.c_str(), "wb");
if (fout NULL)
CV_Error_( CV_StsError, ("Can not open file %s for writing FLANN index\n", filename.c_str()) );
if( algo FLANN_INDEX_LSH )
{
saveIndex_<LshIndex>(this, index, fout);
fclose(out) <---- fix
return;
}
Associated revisions
Merge pull request #1658 from alalek:ocl_fixes
History
Updated by Marius Muja almost 14 years ago
This was fixed in r6757.
- Status changed from Open to Done
- % Done changed from 0 to 100
Updated by Andrey Kamaev almost 13 years ago
- Target version set to 2.4.0