From: Sameer Prakash Pradhan Date: Tue, 28 Aug 2018 08:56:09 +0000 (+0530) Subject: [Non-ACR][contacts-service][tfive-12966] X-Git-Tag: accepted/tizen/5.0/unified/20181102.015855^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F187777%2F2;p=platform%2Fcore%2Fpim%2Fcontacts-service.git [Non-ACR][contacts-service][tfive-12966] Signed-off-by: Sameer Prakash Pradhan Change-Id: I8a0571ee9b176010e4cfe4456459a61b169eded1 --- diff --git a/server/db/ctsvc_db_plugin_contact.c b/server/db/ctsvc_db_plugin_contact.c index de9918e..1507269 100644 --- a/server/db/ctsvc_db_plugin_contact.c +++ b/server/db/ctsvc_db_plugin_contact.c @@ -1596,12 +1596,14 @@ static int __ctsvc_db_contact_get_records_with_query(contacts_query_h query, int } if (false == had_contact_id) { - s_query->projection = realloc(s_query->projection, s_query->projection_count+1); - if (NULL == s_query->projection) { + void *tmp = realloc(s_query->projection, s_query->projection_count+1); + if (NULL == tmp) { /* LCOV_EXCL_START */ ERR("realloc() Fail"); return CONTACTS_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ + } else { + s_query->projection = tmp; } s_query->projection[s_query->projection_count] = CTSVC_PROPERTY_CONTACT_ID;