#10216 closed defect (fixed)

MOHAWK: Riven: Possible memory leak for saveGame

Reported by: dafioram Owned by: bgK
Priority: normal Component: Engine: Mohawk
Keywords: Cc:
Game: Riven

Description

I played through riven with valgrind on. DVD version.
ScummVM: 1.10.0git-4930-gf9a86a6995

==23470== 73,728 bytes in 1 blocks are definitely lost in loss record 2,414 of 2,418
==23470==    at 0x4C2DB2F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==23470==    by 0x1BFCB3: Common::MemoryWriteStreamDynamic::ensureCapacity(unsigned int) (memstream.h:175)
==23470==    by 0x1BFE80: Common::MemoryWriteStreamDynamic::write(void const*, unsigned int) (memstream.h:195)
==23470==    by 0x1BF965: Common::WriteStream::writeUint16BE(unsigned short) (stream.h:145)
==23470==    by 0x2E9898: Graphics::saveThumbnail(Common::WriteStream&, Graphics::Surface const&) (thumbnail.cpp:250)
==23470==    by 0x2E95ED: Graphics::saveThumbnail(Common::WriteStream&) (thumbnail.cpp:208)
==23470==    by 0x1BEB0B: Mohawk::RivenSaveLoad::genTHMBSection() const (riven_saveload.cpp:373)
==23470==    by 0x1BED7D: Mohawk::RivenSaveLoad::saveGame(int, Common::String const&) (riven_saveload.cpp:416)
==23470==    by 0x1ABADB: Mohawk::MohawkEngine_Riven::saveGameState(int, Common::String const&) (riven.cpp:538)
==23470==    by 0x1E7342: Mohawk::MohawkOptionsDialog::save() (dialogs.cpp:133)
==23470==    by 0x1E74F9: Mohawk::MohawkOptionsDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (dialogs.cpp:167)
==23470==    by 0x1E7C82: Mohawk::RivenOptionsDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (dialogs.cpp:308)
==23470== 

Change History (3)

comment:1 Changed 19 months ago by dafioram

A similar memory leak ending with Common::MemoryWriteStreamDynamic::ensureCapacity also happens for:

Mohawk::RivenSaveLoad::genVARSSection
Mohawk::RivenSaveLoad::genNAMESection
Mohawk::RivenSaveLoad::genZIPSSection
Mohawk::RivenSaveLoad::genVERSSection
Mohawk::RivenSaveLoad::genMETASection

comment:2 Changed 19 months ago by dafioram

Summary: MOHAWK: Riven: Possible memory leak for genTHMBSectionMOHAWK: Riven: Possible memory leak for saveGame

comment:3 Changed 19 months ago by bgK

Owner: set to bgK
Resolution: fixed
Status: newclosed

Fixed in 56b744f, thanks.

Note: See TracTickets for help on using tickets.