1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-16 14:00:40 +00:00

Core: fix possible memory leaks.

This commit is contained in:
Andreas Haas
2017-04-06 13:18:41 +02:00
parent 46bc14e66f
commit a2734df7ed
2 changed files with 2 additions and 2 deletions

View File

@@ -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);