Skip to content

Commit

Permalink
WINTERMUTE: Fix mismatched free/delete Valgrind warning
Browse files Browse the repository at this point in the history
The memory stream class uses free() to free memory, so we have to
use malloc(), not new, to allocate it.
  • Loading branch information
Torbjörn Andersson committed Nov 4, 2015
1 parent faff6b5 commit b8caa07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/wintermute/base/file/base_file.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit b8caa07

Please sign in to comment.