mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 21:45:12 +00:00
Cleanup zip file in more failure scenarios
This commit is contained in:
parent
892e48d3da
commit
c1c12feb8f
1 changed files with 3 additions and 0 deletions
|
@ -99,6 +99,7 @@ static bool mod_import_zip(char* path, bool* isLua, bool* isDynos) {
|
|||
snprintf(dstDirectory, SYS_MAX_PATH, "%s", (char*)fs_get_write_path(DYNOS_PACKS_FOLDER));
|
||||
} else {
|
||||
LOG_ERROR("Could not figure out what type of mod this is");
|
||||
mz_zip_reader_end(&zip_archive);
|
||||
return false;
|
||||
}
|
||||
if (!fs_sys_dir_exists(dstDirectory)) {
|
||||
|
@ -159,6 +160,8 @@ static bool mod_import_zip(char* path, bool* isLua, bool* isDynos) {
|
|||
FILE* fout = fopen(dst, "wb");
|
||||
if (fout == NULL) {
|
||||
LOG_ERROR("Failed to open dst path for zip mod import");
|
||||
mz_free((void*)p);
|
||||
mz_zip_reader_end(&zip_archive);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue