[Scummvm-cvs-logs] scummvm master -> b8caa07ddb2e31cdebbbc012adbf11f721a2fd3a

eriktorbjorn eriktorbjorn at telia.com
Wed Nov 4 21:22:04 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b8caa07ddb WINTERMUTE: Fix mismatched free/delete Valgrind warning


Commit: b8caa07ddb2e31cdebbbc012adbf11f721a2fd3a
    https://github.com/scummvm/scummvm/commit/b8caa07ddb2e31cdebbbc012adbf11f721a2fd3a
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-11-04T21:19:42+01:00

Commit Message:
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.

Changed paths:
    engines/wintermute/base/file/base_file.cpp



diff --git a/engines/wintermute/base/file/base_file.cpp b/engines/wintermute/base/file/base_file.cpp
index 2927c90..4589721 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);






More information about the Scummvm-git-logs mailing list