From de4f8ca634b7ad85c5852d7b93cc74d2e92a863f Mon Sep 17 00:00:00 2001 From: scummvmuser <150493071+scummvmuser@users.noreply.github.com> Date: Fri, 26 Jul 2024 19:15:46 -0400 Subject: [PATCH] NANCY: Fix an alloc-dealloc mismatch in iff.cpp IFF::getChunkStream's `dup` is free()d by way of Common::DisposablePtr::~DisposablePtr() --- engines/nancy/iff.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/nancy/iff.cpp b/engines/nancy/iff.cpp index 615fc22d559..dc8b8e95923 100644 --- a/engines/nancy/iff.cpp +++ b/engines/nancy/iff.cpp @@ -111,7 +111,7 @@ Common::SeekableReadStream *IFF::getChunkStream(const Common::String &id, uint i const byte *chunk = getChunk(stringToId(id), size, index); if (chunk) { - byte *dup = new byte[size]; + byte *dup = (byte *)malloc(size); memcpy(dup, chunk, size); return new Common::MemoryReadStream(dup, size, DisposeAfterUse::YES); }