partio icon indicating copy to clipboard operation
partio copied to clipboard

resource leak in ZIP.cpp

Open ghost opened this issue 8 years ago • 0 comments

I found the leak with the static code checking tool cppcheck. There are other minor bugs as well, but this one is the biggest. The leak is found in file master/src/lib/io/ZIP.cpp on line 511

if(read_start<=0){std::cerr<<"ZIP: Invalid read buffer size"<<std::endl;return false;}

it should be:

if(read_start<=0){std::cerr<<"ZIP: Invalid read buffer size"<<std::endl;delete [] buf;return false;}

ghost avatar Oct 28 '16 08:10 ghost