From a5b74fbc0e52eae2f1731a6b5e4b783131e5c170 Mon Sep 17 00:00:00 2001 From: Gukhwan Cho Date: Mon, 31 Aug 2015 11:50:35 +0900 Subject: [PATCH] fixed prevent Change-Id: Ie36f13ff227392017d591daf232a5a7c9f4b52c9 Signed-off-by: Gukhwan Cho --- server/db/ctsvc_db_plugin_activity.c | 4 +++- server/db/ctsvc_db_plugin_contact.c | 6 ++++-- server/db/ctsvc_db_plugin_my_profile.c | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/server/db/ctsvc_db_plugin_activity.c b/server/db/ctsvc_db_plugin_activity.c index 6cf060f..0c7d528 100644 --- a/server/db/ctsvc_db_plugin_activity.c +++ b/server/db/ctsvc_db_plugin_activity.c @@ -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); diff --git a/server/db/ctsvc_db_plugin_contact.c b/server/db/ctsvc_db_plugin_contact.c index 351775e..f3abf09 100644 --- a/server/db/ctsvc_db_plugin_contact.c +++ b/server/db/ctsvc_db_plugin_contact.c @@ -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"); diff --git a/server/db/ctsvc_db_plugin_my_profile.c b/server/db/ctsvc_db_plugin_my_profile.c index 34a8d48..59888cf 100644 --- a/server/db/ctsvc_db_plugin_my_profile.c +++ b/server/db/ctsvc_db_plugin_my_profile.c @@ -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); -- 2.7.4