Coverity issue fix 39/180139/4 accepted/tizen/unified/20180527.044827 submit/tizen/20180525.091410
authorVikas Kumar Agrawal <vikas.ag@samsung.com>
Fri, 25 May 2018 05:34:31 +0000 (11:04 +0530)
committerVikas Kumar Agrawal <vikas.ag@samsung.com>
Fri, 25 May 2018 08:51:57 +0000 (14:21 +0530)
Change-Id: I15aa1e1738350d9fb33262a4672e5198f0d18828
Signed-off-by: Vikas Kumar Agrawal <vikas.ag@samsung.com>
src/apps/apps_data_db.c
src/apps/apps_state_normal.c
src/dbus_util.c
src/layout.c

index 02d8e2d449969f5b42b2d4ca522be4e049ebe706..da79e268da6677478d1672bf85d4ecba862db5bf 100755 (executable)
@@ -332,6 +332,10 @@ char *apps_data_db_get_data(char *key)
                goto ERROR;
        }
        while (sqlite3_step(stmt) == SQLITE_ROW) {
+               if (value) {
+                       free(value);
+                       value = NULL;
+               }
                str = (const char *) sqlite3_column_text(stmt, COL_VALUE);
                value = (!str || !strlen(str)) ? NULL : strdup(str);
        }
@@ -339,6 +343,10 @@ char *apps_data_db_get_data(char *key)
        if (ret != SQLITE_OK) {
                _E("sqlite error [%d]", ret);
                __close_db_connector();
+               if (value) {
+                       free(value);
+                       value = NULL;
+               }
                return NULL;
        }
        __close_db_connector();
@@ -443,7 +451,10 @@ static bool __open_db_connector(void)
 static void __close_db_connector(void)
 {
        if (s_info.db_connector != NULL) {
-               sqlite3_exec(s_info.db_connector, "COMMIT TRANSACTION", NULL, NULL, NULL);
+               int ret = sqlite3_exec(s_info.db_connector, "COMMIT TRANSACTION", NULL, NULL, NULL);
+                if (ret != SQLITE_OK) {
+                       LOGE("SQL error(%d)", ret);
+               }
                sqlite3_close(s_info.db_connector);
                s_info.db_connector = NULL;
        }
index 838c37e711209c71a3a51754e31f7b41ba18f6a2..ca0a6bddd1552332dd788719cc00192b4005a2db 100755 (executable)
@@ -300,8 +300,8 @@ static void __execute_focus_icon(APPS_ICON_INFO *icon_info, int pos)
 static void __execute_auto_open_app(APPS_ICON_INFO *icon_info, int pos)
 {
        int is_open = 0;
-       vconf_get_int(VCONFKEY_SETAPPL_AUTO_OPEN_APPS, &is_open);
-
+       if (vconf_get_int(VCONFKEY_SETAPPL_AUTO_OPEN_APPS, &is_open) < 0)
+                 _E("Failed to get VCONFKEY_SETAPPL_AUTO_OPEN_APPS");
        if (is_open)
                __execute_focus_icon(icon_info, pos);
 }
index 28c66881fe6297e1677eecb9ffba89702b94eade..f96ada377f33d03f164b59f6792634855e7990c5 100755 (executable)
@@ -78,6 +78,7 @@ static int _dbus_message_send(const char *path, const char *interface, const cha
                        g_error_free(error);
                }
                _E("dbus_connection_send error(%s:%s-%s)", path, interface, member);
+               g_object_unref(msg);
                return -1;
        }
 
index 8a90ede5f00b4d2ccd19ee7eb5f271ec1e5e76ac..c35beed36b8b15d97d177bb0f733e0e7891120b8 100755 (executable)
@@ -254,12 +254,18 @@ static Eina_Bool _longpress_timer_cb(void *data)
                case PAGE_DIRECTION_CENTER: {
                        if (util_feature_enabled_get(FEATURE_CLOCK_SELECTOR) != 1)
                                no_effect = 1;
-
+                       int ret = -1;
                        app_control_h app_control_handle = NULL;
-                       app_control_create(&app_control_handle);
+                       ret = app_control_create(&app_control_handle);
+                       if (ret != APP_CONTROL_ERROR_NONE) {
+                               _D("app_control_create failed");
+                               break;
+                       }
                        app_control_set_app_id(app_control_handle, "org.tizen.watch-setting");
                        app_control_add_extra_data(app_control_handle, "launch-type", "watchface");
-                       app_control_send_launch_request(app_control_handle, NULL, NULL);
+                       ret = app_control_send_launch_request(app_control_handle, NULL, NULL);
+                       if (ret != APP_CONTROL_ERROR_NONE)
+                               _D("app_control_send_launch_request failed");
                        app_control_destroy(app_control_handle);
                        break;
                }