You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 17:36:07 +00:00
Core: fix possible memory leaks.
(cherry picked from commit a2734df7ed)
This commit is contained in:
committed by
Rémi Verschelde
parent
5a1bcae6c2
commit
a46dcfe12f
@@ -150,8 +150,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);
|
||||
|
||||
@@ -173,6 +173,7 @@ Error PCKPacker::flush(bool p_verbose) {
|
||||
printf("\n");
|
||||
|
||||
file->close();
|
||||
memdelete(buf);
|
||||
|
||||
return OK;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user