From: Changgyu Choi Date: Wed, 26 Apr 2023 01:16:39 +0000 (+0900) Subject: Fix static analysis issues X-Git-Tag: accepted/tizen/unified/20230601.162943~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec1218d639eb95654c7fc62d796cdc21bf10fe57;p=platform%2Fcore%2Fapi%2Fapp-control.git Fix static analysis issues Changes: - Fix wrong exception handling. - Removes unreachable codes. Change-Id: Id95d2adbe9943d6eeb8748848763b1120d9f326f Signed-off-by: Changgyu Choi --- diff --git a/src/app-control/error.hh b/src/app-control/error.hh index 5098a0e..4f378e9 100644 --- a/src/app-control/error.hh +++ b/src/app-control/error.hh @@ -65,7 +65,6 @@ constexpr const char* ErrorToString(int error) { default: return "Unknown"; } - return "Unknown"; } } // namespace app_control diff --git a/src/app-control/stub.cc b/src/app-control/stub.cc index 4f7b45f..5ea8dcf 100644 --- a/src/app-control/stub.cc +++ b/src/app-control/stub.cc @@ -971,7 +971,7 @@ EXPORT int app_control_add_action_handler(const char* action, ActionExt* p = nullptr; try { - p = new (std::nothrow) ActionExt(action); + p = new ActionExt(action); } catch (Exception& e) { _E("Failed to create action handle. action(%s), error(%d)", action, e.GetErrorCode());