From 60733e9280ebd693293d6e7683af0bd94f8909aa Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Mon, 26 Mar 2012 16:14:02 -0700 Subject: [PATCH] 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 --- adb/commandline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adb/commandline.c b/adb/commandline.c index 5b2aa8849..7af8163a8 100644 --- a/adb/commandline.c +++ b/adb/commandline.c @@ -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;