1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-14 02:33:51 +02:00

Fixed memory leak in CCompressedStream

This commit is contained in:
AlexVinS 2016-08-22 12:56:05 +03:00
parent 71378546c1
commit 63500042e8

View File

@ -103,7 +103,7 @@ CCompressedStream::CCompressedStream(std::unique_ptr<CInputStream> stream, bool
CCompressedStream::~CCompressedStream()
{
inflateEnd(inflateState);
delete inflateState;
vstd::clear_pointer(inflateState);
}
si64 CCompressedStream::readMore(ui8 *data, si64 size)
@ -164,7 +164,7 @@ si64 CCompressedStream::readMore(ui8 *data, si64 size)
if (fileEnded)
{
inflateEnd(inflateState);
inflateState = nullptr;
vstd::clear_pointer(inflateState);
}
return decompressed;
}