[Scummvm-cvs-logs] scummvm master -> 9d28a6f531ad3727675604e24cdeff5ce03decc3

eriktorbjorn eriktorbjorn at telia.com
Sun Jun 2 22:02:21 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9d28a6f531 TONY: Fix potential memory leak


Commit: 9d28a6f531ad3727675604e24cdeff5ce03decc3
    https://github.com/scummvm/scummvm/commit/9d28a6f531ad3727675604e24cdeff5ce03decc3
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2013-06-02T13:00:25-07:00

Commit Message:
TONY: Fix potential memory leak

Unfortunately, I'm not sure where and when this function is called.
But this should be correct. CID 1003575

Changed paths:
    engines/tony/mpal/mpal.cpp



diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index 1a24c5a..1de5c68 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -521,14 +521,15 @@ static LpItem getItemData(uint32 nOrdItem) {
 		dat += dim;
 	}
 
-	// Check if we've got to the end of the file
 	int i = READ_LE_UINT16(dat);
-	if (i != 0xABCD)
-		return NULL;
 
 	globalUnlock(hDat);
 	globalFree(hDat);
 
+	// Check if we've got to the end of the file
+	if (i != 0xABCD)
+		return NULL;
+
 	return ret;
 }
 






More information about the Scummvm-git-logs mailing list