Make sure "adb install" work is cleaned after error

If an error occurs during the verification of an APK, it could be left
in the temporary installation directory.

Change-Id: I4afa5535fc0b978532b31d5b8fb63776963c39db
This commit is contained in:
Kenny Root 2012-03-26 16:14:02 -07:00
parent 31af5f7beb
commit 60733e9280

View file

@ -1575,7 +1575,7 @@ int install_app(transport_type transport, char* serial, int argc, char** argv)
err = do_sync_push(apk_file, apk_dest, 1 /* verify APK */);
if (err) {
return err;
goto cleanup_apk;
} else {
argv[file_arg] = apk_dest; /* destination name, not source location */
}
@ -1591,11 +1591,11 @@ int install_app(transport_type transport, char* serial, int argc, char** argv)
pm_command(transport, serial, argc, argv);
cleanup_apk:
if (verification_file != NULL) {
delete_file(transport, serial, verification_dest);
}
cleanup_apk:
delete_file(transport, serial, apk_dest);
return err;