From 137140b7e98be5ba09a18af148cc87f1c226d74a Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Tue, 29 May 2007 21:06:07 +0000 Subject: removed some resource related memory leaks svn-id: r27007 --- engines/cine/msg.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'engines/cine/msg.cpp') diff --git a/engines/cine/msg.cpp b/engines/cine/msg.cpp index 691c024259..0947cbd45a 100644 --- a/engines/cine/msg.cpp +++ b/engines/cine/msg.cpp @@ -34,7 +34,7 @@ uint16 messageCount; void loadMsg(char *pMsgName) { uint16 i; - byte *ptr; + byte *ptr, *dataPtr; checkDataDisk(-1); @@ -45,14 +45,13 @@ void loadMsg(char *pMsgName) { if (messageTable[i].ptr) { assert(messageTable[i].ptr); - free(messageTable[i].ptr); } messageTable[i].ptr = NULL; } - ptr = readBundleFile(findFileInBundle(pMsgName)); + ptr = dataPtr = readBundleFile(findFileInBundle(pMsgName)); setMouseCursor(MOUSE_CURSOR_DISK); @@ -74,6 +73,8 @@ void loadMsg(char *pMsgName) { ptr += messageTable[i].len; } } + + free(dataPtr); } } // End of namespace Cine -- cgit v1.2.3