wdas / partio

C++ (with python bindings) library for easily reading/writing/manipulating common animation particle formats such as PDB, BGEO, PTC. https://wdas.github.io/partio
https://www.disneyanimation.com/open-source/partio/
Other
458 stars 133 forks source link

resource leak in ZIP.cpp #63

Open ghost opened 7 years ago

ghost commented 7 years ago

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;}