From: Ilho Kim Date: Mon, 21 Sep 2020 06:21:06 +0000 (+0900) Subject: Fix TpkAppQueryInterface when fail to get package id X-Git-Tag: submit/tizen/20201027.061339~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=728af4eb475b81784d97d04f338226fa017ba319;p=platform%2Fcore%2Fappfw%2Ftpk-backend.git Fix TpkAppQueryInterface when fail to get package id The temporary file should be removed when fail to get package id Change-Id: I28827f4210bc7af0f7a9c081e87ac1c2dee1ccc9 Signed-off-by: Ilho Kim --- diff --git a/src/tpk/tpk_app_query_interface.cc b/src/tpk/tpk_app_query_interface.cc index c25ae11..d4964c8 100644 --- a/src/tpk/tpk_app_query_interface.cc +++ b/src/tpk/tpk_app_query_interface.cc @@ -51,12 +51,16 @@ std::string TpkAppQueryInterface::GetPkgIdFromPath( } tpk::parse::TPKConfigParser parser; - if (!parser.ParseManifest(manifest_path)) + if (!parser.ParseManifest(manifest_path)) { + ci::RemoveAll(tmp_path); return {}; + } auto package_info = std::static_pointer_cast( parser.GetManifestData(tpk::application_keys::kManifestKey)); - if (!package_info) + if (!package_info) { + ci::RemoveAll(tmp_path); return {}; + } std::string pkg_id = package_info->package(); ci::RemoveAll(tmp_path); return pkg_id;