From 9d28a6f531ad3727675604e24cdeff5ce03decc3 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 2 Jun 2013 22:00:25 +0200 Subject: TONY: Fix potential memory leak Unfortunately, I'm not sure where and when this function is called. But this should be correct. CID 1003575 --- engines/tony/mpal/mpal.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp index 1a24c5a576..1de5c6850c 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; } -- cgit v1.2.3