From: Junghyun Kim Date: Fri, 1 Feb 2013 06:50:25 +0000 (+0400) Subject: Fix Prevent issue X-Git-Tag: accepted/tizen/20130530.164646~1^2~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bcdf3b2df5c05f2103aada445f791cb2a2e175b4;hp=06b766f33c29e7bc1f1bf6d2646f2b5f3b72541e;p=apps%2Fcore%2Fpreloaded%2Fsmartsearch.git Fix Prevent issue --- diff --git a/data/images/B10_btn_icon_Phone.png b/data/images/B10_btn_icon_Phone.png old mode 100755 new mode 100644 index 7292657..5e7b413 Binary files a/data/images/B10_btn_icon_Phone.png and b/data/images/B10_btn_icon_Phone.png differ diff --git a/src/ps_searcher.cpp b/src/ps_searcher.cpp index cfcb66f..ed43f30 100755 --- a/src/ps_searcher.cpp +++ b/src/ps_searcher.cpp @@ -167,9 +167,9 @@ int search_sql_contact_search_result_by_api(struct search_content_object *obj, struct appdata *ad = (struct appdata *)data; int ret = 0; - contacts_query_h query; - contacts_filter_h filter; - contacts_list_h list; + contacts_query_h query = NULL; + contacts_filter_h filter = NULL; + contacts_list_h list = NULL; unsigned int count = 0; int total_cnt = -1; @@ -2130,9 +2130,9 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj, /* Check Whether Thumbnail Image exist or not */ if (contact_id > -1) { - contacts_query_h query; - contacts_filter_h filter; - contacts_list_h list; + contacts_query_h query = NULL; + contacts_filter_h filter = NULL; + contacts_list_h list = NULL; unsigned int count = 0; ret = contacts_connect2(); @@ -2141,7 +2141,7 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj, SEARCH_DEBUG_WARNING("Fail to connect contact service!"); if (obj->obj_icon_path != NULL) { sel_mem_info->icon1 = strdup(obj->obj_icon_path); - } + } continue; } else { contacts_query_create(_contacts_person_number._uri, &query); @@ -2156,14 +2156,24 @@ int search_sql_msg_search_result_by_api(struct search_content_object *obj, contacts_record_h record; contacts_list_get_current_record_p(list, &record); contacts_record_get_str_p(record, _contacts_person.image_thumbnail_path, &img_path); - } + } - if (img_path != NULL) { + if (img_path != NULL) { sel_mem_info->icon1 = strdup(img_path); } else if (obj->obj_icon_path != NULL) { sel_mem_info->icon1 = strdup(obj->obj_icon_path); } - contacts_list_destroy(list, true); + if (filter) { + contacts_filter_destroy(filter); + } + + if (query) { + contacts_query_destroy(query); + } + if (list) { + contacts_list_destroy(list, true); + } + ret = contacts_disconnect2(); } } else { diff --git a/src/smartsearch.cpp b/src/smartsearch.cpp index ef7bf45..a372238 100755 --- a/src/smartsearch.cpp +++ b/src/smartsearch.cpp @@ -458,13 +458,13 @@ static int __search_init_db_connect(struct appdata *ad) ret = search_sql_prepare_stmt(ad->search_db_hd, query_list[i], &(ad->search_db_sql[i])); - } - } - - return ret; + } + } SEARCH_FUNC_END; - } + + return ret; +} static void __search_deinit_db_connect(struct appdata *ad) {