copc-lib
copc-lib copied to clipboard
memory leak in copc::FileReader
The constructor of copc::FileReader calls initialization functions which may throw an exception. When an exception is thrown, the construction of the copc::FileReader object is interrupted and its deconstructor will not be called. Thus, the memory of std::fstream object 'f_stream' leaks.
@Haojia521 thanks for the report! Looks like some refactoring will be needed since we raise exceptions in a few methods called by constructors.