aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2012-03-28 01:51:56 +0100
committerD G Turner2012-03-28 01:51:56 +0100
commitb01d712a63a1a6de4e0376fed1f2b7ef8829d17f (patch)
tree19137d8341489d0ee0601d19e75ae5785dcff08e
parent6523a32334491532a7fe6f9efd96585d4d1188ce (diff)
downloadscummvm-rg350-b01d712a63a1a6de4e0376fed1f2b7ef8829d17f.tar.gz
scummvm-rg350-b01d712a63a1a6de4e0376fed1f2b7ef8829d17f.tar.bz2
scummvm-rg350-b01d712a63a1a6de4e0376fed1f2b7ef8829d17f.zip
CGE: Close memory leak in savegame loading.
-rw-r--r--engines/cge/cge_main.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 27bc47b651..05a94df606 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -216,6 +216,7 @@ bool CGEEngine::loadGame(int slotNumber, SavegameHeader *header, bool tiny) {
byte *dataBuffer = (byte *)malloc(size);
saveFile->read(dataBuffer, size);
readStream = new Common::MemoryReadStream(dataBuffer, size, DisposeAfterUse::YES);
+ delete saveFile;
}
// Check to see if it's a ScummVM savegame or not