From c3bae66b56b2258655d9d2af725f17fab94649b2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 18 Feb 2016 10:21:19 +0100 Subject: WAGE: Plug memory leak --- engines/wage/script.cpp | 1 + engines/wage/world.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'engines') diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp index b7e77dfcca..42fde9f503 100644 --- a/engines/wage/script.cpp +++ b/engines/wage/script.cpp @@ -175,6 +175,7 @@ bool Script::execute(World *world, int loopCount, Common::String *inputText, Des Operand *op = readStringOperand(); // allows empty menu // TODO check op type is string. _engine->setMenu(op->toString()); + delete op; byte d = _data->readByte(); if (d != 0xFD) warning("Operand 0x8B (PRINT) End Byte != 0xFD"); diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp index 63b77a5501..73abebc38d 100644 --- a/engines/wage/world.cpp +++ b/engines/wage/world.cpp @@ -274,6 +274,7 @@ bool World::loadWorld(Common::MacResManager *resMan) { for (uint i = 0; i < string.size() && string[i] != ';'; i++) // Read token _aboutMenuItemName += string[i]; + delete menu; delete res; } res = resMan->getResource(MKTAG('M','E','N','U'), 2004); -- cgit v1.2.3