Check return type 16/264516/1
authorAbhimanyu Swami <abhimanyu1.s@samsung.com>
Thu, 23 Sep 2021 17:01:46 +0000 (22:31 +0530)
committerAbhimanyu Swami <abhimanyu1.s@samsung.com>
Thu, 23 Sep 2021 17:01:46 +0000 (22:31 +0530)
Change-Id: Ief6e2780355939214d74199e55698e9f75be6caf
Signed-off-by: Abhimanyu Swami <abhimanyu1.s@samsung.com>
server/ctsvc_ipc_server.c

index 3cda369..836a079 100644 (file)
@@ -1502,6 +1502,9 @@ void ctsvc_ipc_server_db_delete_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                        /* LCOV_EXCL_STOP */
                }
                ids = (int*)malloc(sizeof(int)*count);
+               if (ids == NULL) {
+                       ERR("malloc failed()");
+               }
                for (i = 0; i < count; i++) {
                        ret = ctsvc_ipc_unmarshal_int(indata, &ids[i]);
                        if (ret != CONTACTS_ERROR_NONE) {
@@ -1638,6 +1641,9 @@ void ctsvc_ipc_server_db_replace_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                }
 
                ids = (int*)malloc(sizeof(int)*count);
+               if (ids == NULL) {
+                       ERR("malloc() failed");
+               }
                for (i = 0; i < count; i++) {
                        ret = ctsvc_ipc_unmarshal_int(indata, &ids[i]);
                        if (ret != CONTACTS_ERROR_NONE) {