fixed prevent 41/47841/1
authorGukhwan Cho <gh78.cho@samsung.com>
Mon, 31 Aug 2015 02:50:35 +0000 (11:50 +0900)
committerGukhwan Cho <gh78.cho@samsung.com>
Wed, 9 Sep 2015 10:28:34 +0000 (19:28 +0900)
Change-Id: Ie36f13ff227392017d591daf232a5a7c9f4b52c9
Signed-off-by: Gukhwan Cho <gh78.cho@samsung.com>
server/db/ctsvc_db_plugin_activity.c
server/db/ctsvc_db_plugin_contact.c
server/db/ctsvc_db_plugin_my_profile.c

index 6cf060f..0c7d528 100644 (file)
@@ -352,8 +352,10 @@ static int __ctsvc_db_activity_get_records_with_query(contacts_query_h query, in
                        }
                }
        }
-       else
+       else {
+               s_query->projection_count = 0;
                had_activity_id = true;
+       }
 
        if (false == had_activity_id) {
                s_query->projection = realloc(s_query->projection, s_query->projection_count+1);
index 351775e..f3abf09 100644 (file)
@@ -1471,10 +1471,12 @@ static int __ctsvc_db_contact_get_records_with_query(contacts_query_h query, int
                        }
                }
        }
-       else
+       else {
+               s_query->projection_count = 0;
                had_contact_id = true;
+       }
 
-       if (0 == had_contact_id) {
+       if (false == had_contact_id) {
                s_query->projection = realloc(s_query->projection, s_query->projection_count+1);
                if (NULL == s_query->projection) {
                        CTS_ERR("realloc() Fail");
index 34a8d48..59888cf 100644 (file)
@@ -902,8 +902,10 @@ static int __ctsvc_db_my_profile_get_records_with_query(contacts_query_h query,
                        }
                }
        }
-       else
+       else {
+               s_query->projection_count = 0;
                had_my_profile_id = true;
+       }
 
        if (false == had_my_profile_id) {
                s_query->projection = realloc(s_query->projection, s_query->projection_count+1);