[Scummvm-cvs-logs] SF.net SVN: scummvm: [23019] scummvm/trunk/common

vinterstum at users.sourceforge.net vinterstum at users.sourceforge.net
Sun Jun 11 04:23:31 CEST 2006


Revision: 23019
Author:   vinterstum
Date:     2006-06-10 19:23:17 -0700 (Sat, 10 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23019&view=rev

Log Message:
-----------
Applied the patch included in bug rep [ 1503716 ] Leak in File::Open (on OS X) and unzOpen (on all)

Modified Paths:
--------------
    scummvm/trunk/common/file.cpp
    scummvm/trunk/common/unzip.cpp
Modified: scummvm/trunk/common/file.cpp
===================================================================
--- scummvm/trunk/common/file.cpp	2006-06-10 22:26:46 UTC (rev 23018)
+++ scummvm/trunk/common/file.cpp	2006-06-11 02:23:17 UTC (rev 23019)
@@ -249,7 +249,9 @@
 				if (CFURLGetFileSystemRepresentation(fileUrl, false, (UInt8 *)buf, 256)) {
 					_handle = fopen((char *)buf, modeStr);
 				}
+				CFRelease(fileUrl);
 			}
+			CFRelease(cfFileName);
 		}
 #endif
 

Modified: scummvm/trunk/common/unzip.cpp
===================================================================
--- scummvm/trunk/common/unzip.cpp	2006-06-10 22:26:46 UTC (rev 23018)
+++ scummvm/trunk/common/unzip.cpp	2006-06-11 02:23:17 UTC (rev 23019)
@@ -326,11 +326,10 @@
 
 	int err=UNZ_OK;
 
-    if (unz_copyright[0]!=' ')
-        return NULL;
-
-	if (!us->file.open(path))
+	if (!us->file.open(path)) {
+		delete us;
 		return NULL;
+	}
 
 	central_pos = unzlocal_SearchCentralDir(us->file);
 	if (central_pos==0)
@@ -361,8 +360,8 @@
 		err=UNZ_ERRNO;
 
 	if ((number_entry_CD!=us->gi.number_entry) ||
-		(number_disk_with_CD!=0) ||
-		(number_disk!=0))
+	    (number_disk_with_CD!=0) ||
+	    (number_disk!=0))
 		err=UNZ_BADZIPFILE;
 
 	/* size of the central directory */
@@ -379,11 +378,10 @@
 		err=UNZ_ERRNO;
 
 	if ((central_pos<us->offset_central_dir+us->size_central_dir) &&
-		(err==UNZ_OK))
+	    (err==UNZ_OK))
 		err=UNZ_BADZIPFILE;
 
-	if (err!=UNZ_OK)
-	{
+	if (err!=UNZ_OK) {
 		us->file.close();
 		delete us;
 		return NULL;
@@ -411,8 +409,8 @@
 		return UNZ_PARAMERROR;
 	s=(unz_s*)file;
 
-    if (s->pfile_in_zip_read!=NULL)
-        unzCloseCurrentFile(file);
+	if (s->pfile_in_zip_read!=NULL)
+		unzCloseCurrentFile(file);
 
 	s->file.close();
 	delete s;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list