diff options
author | Gregory Montoir | 2007-05-29 21:06:07 +0000 |
---|---|---|
committer | Gregory Montoir | 2007-05-29 21:06:07 +0000 |
commit | 137140b7e98be5ba09a18af148cc87f1c226d74a (patch) | |
tree | fefe32aaad76f313e5f5ccedcbccbf2e8c56449b /engines/cine/msg.cpp | |
parent | 73210b4aa3f27402e66ec778c20ab21353d31cc1 (diff) | |
download | scummvm-rg350-137140b7e98be5ba09a18af148cc87f1c226d74a.tar.gz scummvm-rg350-137140b7e98be5ba09a18af148cc87f1c226d74a.tar.bz2 scummvm-rg350-137140b7e98be5ba09a18af148cc87f1c226d74a.zip |
removed some resource related memory leaks
svn-id: r27007
Diffstat (limited to 'engines/cine/msg.cpp')
-rw-r--r-- | engines/cine/msg.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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 |