[Non-ACR][contacts-service][tfive-12966] 77/187777/2 accepted/tizen/5.0/unified/20181102.015855 accepted/tizen/unified/20180830.060624 submit/tizen/20180828.103848 submit/tizen_5.0/20181101.000003
authorSameer Prakash Pradhan <sp.pradhan@samsung.com>
Tue, 28 Aug 2018 08:56:09 +0000 (14:26 +0530)
committerSameer Prakash Pradhan <sp.pradhan@samsung.com>
Tue, 28 Aug 2018 09:45:57 +0000 (15:15 +0530)
Signed-off-by: Sameer Prakash Pradhan <sp.pradhan@samsung.com>
Change-Id: I8a0571ee9b176010e4cfe4456459a61b169eded1

server/db/ctsvc_db_plugin_contact.c

index de9918e..1507269 100644 (file)
@@ -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;