diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-04-06 14:34:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-06 14:34:21 +0200 |
commit | 1a33d5e06fa941d1acf219ef865dfb0425f302dd (patch) | |
tree | 82610c598b98bcd39b912fa71c24419b8ad5802c /core/io/file_access_zip.cpp | |
parent | 243849583a5c0a8564aa33b509a43827f818750c (diff) | |
parent | a2734df7edb244e92006be47f4bfb9f96115b277 (diff) | |
download | redot-engine-1a33d5e06fa941d1acf219ef865dfb0425f302dd.tar.gz |
Merge pull request #8286 from Hinsbart/memleaks
Core: fix possible memory leaks.
Diffstat (limited to 'core/io/file_access_zip.cpp')
-rw-r--r-- | core/io/file_access_zip.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index 4cc2edd1c3..47432b1e97 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -149,8 +149,7 @@ unzFile ZipArchive::get_file_handle(String p_file) const { unzFile pkg = unzOpen2(packages[file.package].filename.utf8().get_data(), &io); ERR_FAIL_COND_V(!pkg, NULL); int unz_err = unzGoToFilePos(pkg, &file.file_pos); - ERR_FAIL_COND_V(unz_err != UNZ_OK, NULL); - if (unzOpenCurrentFile(pkg) != UNZ_OK) { + if (unz_err != UNZ_OK || unzOpenCurrentFile(pkg) != UNZ_OK) { unzClose(pkg); ERR_FAIL_V(NULL); |