WINTERMUTE: Fix mismatched free/delete Valgrind warning

The memory stream class uses free() to free memory, so we have to
use malloc(), not new, to allocate it.
This commit is contained in:
Torbjörn Andersson 2015-11-04 21:19:42 +01:00
parent faff6b534d
commit b8caa07ddb

View File

@ -57,7 +57,7 @@ bool BaseFile::isEOF() {
Common::SeekableReadStream *BaseFile::getMemStream() {
uint32 oldPos = getPos();
seek(0);
byte *data = new byte[getSize()];
byte *data = (byte *)malloc(getSize());
read(data, getSize());
seek(oldPos);
Common::MemoryReadStream *memStream = new Common::MemoryReadStream(data, getSize(), DisposeAfterUse::YES);