free up writer memory when failing to open archive for reading

This commit is contained in:
Cœur
2025-05-05 00:12:57 +02:00
committed by Nathan Moinvaziri
parent 4b770114a0
commit 4e88434cdf

View File

@@ -460,6 +460,7 @@ int32_t minizip_erase(const char *src_path, const char *target_path, int32_t arg
if (err != MZ_OK) {
printf("Error %" PRId32 " opening archive for reading %s\n", err, src_path);
mz_zip_reader_delete(&reader);
mz_zip_writer_delete(&writer);
return err;
}