coverity issue solved for resource leak 13/282413/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.062501 accepted/tizen/7.0/unified/hotfix/20221116.105507 accepted/tizen/unified/20221005.023209 tizen_7.0_m2_release
authorKrishna Kant Jaju <krishna.jaju@samsung.com>
Mon, 3 Oct 2022 08:36:35 +0000 (14:06 +0530)
committerKrishna Kant Jaju <krishna.jaju@samsung.com>
Mon, 3 Oct 2022 08:38:58 +0000 (14:08 +0530)
Change-Id: I217ee29d841ea720b1eeb50df32596a436d2e2a1
Signed-off-by: Krishna Kant Jaju <krishna.jaju@samsung.com>
server/ctsvc_ipc_server.c

index d8d6907..5e0722f 100644 (file)
@@ -1504,6 +1504,8 @@ void ctsvc_ipc_server_db_delete_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                ids = (int*)malloc(sizeof(int)*count);
                if (ids == NULL) {
                        ERR("malloc failed()");
+                       ctsvc_handle_destroy(contact);
+                       free(uri);
                        return;
                }
                for (i = 0; i < count; i++) {
@@ -1644,6 +1646,8 @@ 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");
+                       ctsvc_handle_destroy(contact);
+                       contacts_list_destroy(list, true);
                        return;
                }
                for (i = 0; i < count; i++) {