fix prevent issues 70/45670/1
authorGukhwan Cho <gh78.cho@samsung.com>
Tue, 30 Jun 2015 09:17:52 +0000 (18:17 +0900)
committerMyoungHoon Chae <mhoon.chae@samsung.com>
Mon, 10 Aug 2015 08:31:02 +0000 (17:31 +0900)
Change-Id: I3d349b7d346c275672c6556a8dfc6cb97e8e0831
Signed-off-by: Gukhwan Cho <gh78.cho@samsung.com>
client/ctsvc_client_noti.c
client/ctsvc_client_setting.c

index 3b36a07..ba195cf 100644 (file)
@@ -193,6 +193,11 @@ API int contacts_db_add_changed_cb_with_info(const char* view_uri,
        }
 
        cb_info = calloc(1, sizeof(db_callback_info_s));
+       if (NULL == cb_info) {
+               CTS_ERR("calloc() Failed");
+               ctsvc_mutex_unlock(CTS_MUTEX_PIMS_IPC_PUBSUB);
+               return CONTACTS_ERROR_OUT_OF_MEMORY;
+       }
        cb_info->user_data = user_data;
        cb_info->cb = cb;
        info->callbacks = g_slist_append(info->callbacks, cb_info);
index 71ca785..7411258 100755 (executable)
@@ -218,6 +218,11 @@ API int contacts_setting_add_name_display_order_changed_cb(
        }
 
        cb_info = calloc(1, sizeof(ctsvc_name_display_order_changed_cb_info_s));
+       if (NULL == cb_info) {
+               CTS_ERR("calloc() Failed");
+               ctsvc_mutex_unlock(CTS_MUTEX_PIMS_IPC_PUBSUB);
+               return CONTACTS_ERROR_OUT_OF_MEMORY;
+       }
        cb_info->user_data = user_data;
        cb_info->cb = cb;
        __setting_name_display_order_subscribe_list = g_slist_append(__setting_name_display_order_subscribe_list, cb_info);
@@ -315,6 +320,11 @@ API int contacts_setting_add_name_sorting_order_changed_cb(
        }
 
        cb_info = calloc(1, sizeof(ctsvc_name_sorting_order_changed_cb_info_s));
+       if (NULL == cb_info) {
+               CTS_ERR("calloc() Failed");
+               ctsvc_mutex_unlock(CTS_MUTEX_PIMS_IPC_PUBSUB);
+               return CONTACTS_ERROR_OUT_OF_MEMORY;
+       }
        cb_info->user_data = user_data;
        cb_info->cb = cb;
        __setting_name_sorting_order_subscribe_list = g_slist_append(__setting_name_sorting_order_subscribe_list, cb_info);