diff options
author | Oystein Eftevaag | 2006-06-11 02:23:17 +0000 |
---|---|---|
committer | Oystein Eftevaag | 2006-06-11 02:23:17 +0000 |
commit | 0aa06392f8e60dde611aaa424eb4cea226b091b8 (patch) | |
tree | 7f77ecf0a4223207c797b225b0cec515f184815f | |
parent | 4adb798232f9f2b2a0c6e05cb0dfb7f05a7aa511 (diff) | |
download | scummvm-rg350-0aa06392f8e60dde611aaa424eb4cea226b091b8.tar.gz scummvm-rg350-0aa06392f8e60dde611aaa424eb4cea226b091b8.tar.bz2 scummvm-rg350-0aa06392f8e60dde611aaa424eb4cea226b091b8.zip |
Applied the patch included in bug rep [ 1503716 ] Leak in File::Open (on OS X) and unzOpen (on all)
svn-id: r23019
-rw-r--r-- | common/file.cpp | 2 | ||||
-rw-r--r-- | common/unzip.cpp | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/common/file.cpp b/common/file.cpp index 9b691dc1b3..346093f2fc 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -249,7 +249,9 @@ bool File::open(const String &filename, AccessMode mode) { if (CFURLGetFileSystemRepresentation(fileUrl, false, (UInt8 *)buf, 256)) { _handle = fopen((char *)buf, modeStr); } + CFRelease(fileUrl); } + CFRelease(cfFileName); } #endif diff --git a/common/unzip.cpp b/common/unzip.cpp index c9f534820f..77e0776006 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -326,11 +326,10 @@ extern unzFile ZEXPORT unzOpen (const char *path) 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 @@ extern unzFile ZEXPORT unzOpen (const char *path) 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 @@ extern unzFile ZEXPORT unzOpen (const char *path) 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 @@ extern int ZEXPORT unzClose (unzFile file) 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; |