fix svace issues 14/126014/1 accepted/tizen/unified/20170420.155807 submit/tizen/20170420.093216
authorJongkyu Koo <jk.koo@samsung.com>
Thu, 20 Apr 2017 01:01:14 +0000 (10:01 +0900)
committerJongkyu Koo <jk.koo@samsung.com>
Thu, 20 Apr 2017 01:01:14 +0000 (10:01 +0900)
Change-Id: I1d94c75f1af63d9be5f40af8bac12d0903393046
Signed-off-by: Jongkyu Koo <jk.koo@samsung.com>
client/ctsvc_client_db_helper.c
server/ctsvc_ipc_server2.c
server/ctsvc_server.c
server/ctsvc_server_person.c

index 044c56e..f03a6c8 100644 (file)
@@ -576,6 +576,7 @@ int ctsvc_client_db_get_records_with_query(contacts_h contact, contacts_query_h
        if (ret != CONTACTS_ERROR_NONE) {
                /* LCOV_EXCL_START */
                ERR("ctsvc_ipc_marshal_int() Fail(%d)", ret);
+               pims_ipc_data_destroy(indata);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -1622,6 +1623,7 @@ int ctsvc_client_db_search_records_with_query_for_snippet(contacts_h contact,
        if (ret != CONTACTS_ERROR_NONE) {
                /* LCOV_EXCL_START */
                ERR("ctsvc_ipc_marshal_int() Fail(%d)", ret);
+               pims_ipc_data_destroy(indata);
                return ret;
                /* LCOV_EXCL_STOP */
        }
@@ -1944,6 +1946,7 @@ int ctsvc_client_db_search_records_with_query(contacts_h contact, contacts_query
        if (ret != CONTACTS_ERROR_NONE) {
                /* LCOV_EXCL_START */
                ERR("ctsvc_ipc_marshal_int() Fail(%d)", ret);
+               pims_ipc_data_destroy(indata);
                return ret;
                /* LCOV_EXCL_STOP */
        }
index 09ca1f9..c30a40f 100644 (file)
@@ -1156,7 +1156,7 @@ void ctsvc_ipc_phone_log_reset_statistics_by_sim(pims_ipc_h ipc,
                pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
 {
        int ret;
-       int sim_slot_no;
+       int sim_slot_no = 0;
        contacts_h contact = NULL;
 
        if (indata) {
@@ -1175,6 +1175,12 @@ void ctsvc_ipc_phone_log_reset_statistics_by_sim(pims_ipc_h ipc,
                        goto ERROR_RETURN;
                        /* LCOV_EXCL_STOP */
                }
+       } else {
+               /* LCOV_EXCL_START */
+               ret = CONTACTS_ERROR_IPC;
+               ERR("ctsvc_ipc_phone_log_reset_statistics_by_sim() Fail");
+               goto ERROR_RETURN;
+               /* LCOV_EXCL_STOP */
        }
 
        if (!ctsvc_have_permission(ipc, CTSVC_PERMISSION_PHONELOG_WRITE)) {
index 13fb495..786b799 100644 (file)
@@ -217,7 +217,10 @@ static int __server_main(void)
                                        CTSVC_IPC_SERVER_PHONELOG_RESET_STATISTICS,
                                        ctsvc_ipc_phone_log_reset_statistics, NULL) != 0)
                        break;
-               if (pims_ipc_svc_register(CTSVC_IPC_PHONELOG_MODULE, CTSVC_IPC_SERVER_PHONELOG_RESET_STATISTICS_BY_SIM, ctsvc_ipc_phone_log_reset_statistics_by_sim, NULL) != 0) break;
+               if (pims_ipc_svc_register(CTSVC_IPC_PHONELOG_MODULE,
+                                       CTSVC_IPC_SERVER_PHONELOG_RESET_STATISTICS_BY_SIM,
+                                       ctsvc_ipc_phone_log_reset_statistics_by_sim, NULL) != 0)
+                       break;
 
                if (pims_ipc_svc_register(CTSVC_IPC_PHONELOG_MODULE,
                                        CTSVC_IPC_SERVER_PHONELOG_DELETE,
index 8fd4fde..171b987 100644 (file)
@@ -1954,6 +1954,7 @@ int ctsvc_person_get_aggregation_suggestions(int person_id, int limit, contacts_
        if (0 == sub_len) {
                *out_list = NULL;
                free(sub_query);
+               free(query);
                DBG("no person_id for aggregation suggestions");
                return CONTACTS_ERROR_NO_DATA;
        }