Fix unmatched memory free

Before the memory of size 1 was deleted, more allocated.
This commit is contained in:
Paweł Bylica 2017-02-24 00:15:56 +01:00
parent c2dbd9968f
commit 660373cf38
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF
1 changed files with 1 additions and 1 deletions

View File

@ -67,7 +67,7 @@ std::shared_ptr<SawyerChunk> SawyerChunkReader::ReadChunk()
case CHUNK_ENCODING_RLECOMPRESSED:
case CHUNK_ENCODING_ROTATE:
{
std::unique_ptr<uint8> compressedData = std::unique_ptr<uint8>(Memory::Allocate<uint8>(header.length));
std::unique_ptr<uint8[]> compressedData(new uint8[header.length]);
if (_stream->TryRead(compressedData.get(), header.length) != header.length)
{
throw SawyerChunkException("Corrupt chunk size.");