summaryrefslogtreecommitdiffstats
path: root/src/ipsw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipsw.c')
-rw-r--r--src/ipsw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index cebfa49..9eeaab1 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -683,13 +683,15 @@ int ipsw_extract_to_memory(ipsw_archive_t ipsw, const char* infile, void** pbuff
}
zip_int64_t zr = zip_fread(zfile, buffer, size);
+ int zep = 0;
+ int sep = 0;
+ if (zr < 0) {
+ zip_file_error_get(zfile, &zep, &sep);
+ }
zip_fclose(zfile);
zip_unchange_all(zip);
zip_close(zip);
if (zr < 0) {
- int zep = 0;
- int sep = 0;
- zip_file_error_get(zfile, &zep, &sep);
logger(LL_ERROR, "zip_fread: %s %d %d\n", infile, zep, sep);
free(buffer);
return -1;