mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fixed memory leak in CCompressedStream
This commit is contained in:
		| @@ -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; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user