Fix static analysis issues 94/291994/5
authorChanggyu Choi <changyu.choi@samsung.com>
Wed, 26 Apr 2023 01:16:39 +0000 (10:16 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Thu, 27 Apr 2023 05:03:04 +0000 (14:03 +0900)
Changes:
 - Fix wrong exception handling.
 - Removes unreachable codes.

Change-Id: Id95d2adbe9943d6eeb8748848763b1120d9f326f
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/app-control/error.hh
src/app-control/stub.cc

index 5098a0e9518e53b801f10cb1bc1a4807b7807be8..4f378e9c984e9d38c1d881af99ba6a2c812b540f 100644 (file)
@@ -65,7 +65,6 @@ constexpr const char* ErrorToString(int error) {
     default:
       return "Unknown";
   }
-  return "Unknown";
 }
 
 }  // namespace app_control
index 4f7b45ff8df2cfae7da80f391e93dd781a6b3f04..5ea8dcfd01fcfb34f5d197b5c6eae681dff89522 100644 (file)
@@ -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());