openspades
openspades copied to clipboard
Memory leak in `ZipFileSystem`
In the above C(VE)++ code, ZipFileSystem::OpenForReading constructs ZipFileInputStream and stores a pointer to it in a variable named currentStream. While it might look like currentStream is properly deleted in all code paths, it's actually a member variable. currentStream->ForceCloseUnzipFile() implicitly clears it without deleting it, leaking memory.
(Thank you @Haxk20 for suggesting the use of valgrind.)