summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ipsw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index 9c78da9..a66d4b1 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -461,6 +461,10 @@ int ipsw_download_latest_fw(plist_t version_data, const char* product, const cha
res = -1;
}
fclose(f);
+
+ // make sure to remove invalid files
+ if (res < 0)
+ remove(fwlfn);
} else {
error("ERROR: Can't open '%s' for checksum verification\n", fwlfn);
res = -1;