diff options
-rw-r--r-- | src/ideviceinstaller.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index 2d07a03..a99df2c 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c @@ -637,6 +637,21 @@ run_again: goto leave_cleanup; } + char **strs = NULL; + if (afc_get_file_info(afc, PKG_PATH, &strs) != AFC_E_SUCCESS) { + if (afc_make_directory(afc, PKG_PATH) != AFC_E_SUCCESS) { + fprintf(stderr, "WARNING: Could not create directory '%s' on device!\n", PKG_PATH); + } + } + if (strs) { + int i = 0; + while (strs[i]) { + free(strs[i]); + i++; + } + free(strs); + } + /* open install package */ int errp = 0; struct zip *zf = zip_open(appid, 0, &errp); @@ -831,21 +846,6 @@ run_again: printf("Copying '%s' --> '%s'\n", appid, pkgname); - char **strs = NULL; - if (afc_get_file_info(afc, PKG_PATH, &strs) != AFC_E_SUCCESS) { - if (afc_make_directory(afc, PKG_PATH) != AFC_E_SUCCESS) { - fprintf(stderr, "WARNING: Could not create directory '%s' on device!\n", PKG_PATH); - } - } - if (strs) { - int i = 0; - while (strs[i]) { - free(strs[i]); - i++; - } - free(strs); - } - if (afc_upload_file(afc, appid, pkgname) < 0) { free(pkgname); goto leave_cleanup; |