From 2fd6599c3b5adedd7e6af5caf3d3ad5136ebd2f8 Mon Sep 17 00:00:00 2001 From: Abhimanyu Swami Date: Thu, 23 Sep 2021 22:31:46 +0530 Subject: [PATCH] Check return type Change-Id: Ief6e2780355939214d74199e55698e9f75be6caf Signed-off-by: Abhimanyu Swami --- server/ctsvc_ipc_server.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/ctsvc_ipc_server.c b/server/ctsvc_ipc_server.c index 3cda369..836a079 100644 --- a/server/ctsvc_ipc_server.c +++ b/server/ctsvc_ipc_server.c @@ -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) { -- 2.7.4