aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/file/base_file.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2015-11-04 21:19:42 +0100
committerTorbjörn Andersson2015-11-04 21:19:42 +0100
commitb8caa07ddb2e31cdebbbc012adbf11f721a2fd3a (patch)
tree6413a332c23ebcf228462ab5fee0f4fdfe937b26 /engines/wintermute/base/file/base_file.cpp
parentfaff6b534def656444cac5f33d14368f8cdb3bd5 (diff)
downloadscummvm-rg350-b8caa07ddb2e31cdebbbc012adbf11f721a2fd3a.tar.gz
scummvm-rg350-b8caa07ddb2e31cdebbbc012adbf11f721a2fd3a.tar.bz2
scummvm-rg350-b8caa07ddb2e31cdebbbc012adbf11f721a2fd3a.zip
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.
Diffstat (limited to 'engines/wintermute/base/file/base_file.cpp')
-rw-r--r--engines/wintermute/base/file/base_file.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/wintermute/base/file/base_file.cpp b/engines/wintermute/base/file/base_file.cpp
index 2927c908e2..4589721e7e 100644
--- a/engines/wintermute/base/file/base_file.cpp
+++ b/engines/wintermute/base/file/base_file.cpp
@@ -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);