diff options
author | Junghyun Kim <jh1114.kim@samsung.com> | 2013-02-01 10:50:25 +0400 |
---|---|---|
committer | Junghyun Kim <jh1114.kim@samsung.com> | 2013-02-01 10:50:25 +0400 |
commit | bcdf3b2df5c05f2103aada445f791cb2a2e175b4 (patch) | |
tree | 296b8b2131ac86ce11a3a78d6696aa85c95f465b | |
parent | 06b766f33c29e7bc1f1bf6d2646f2b5f3b72541e (diff) | |
download | smartsearch-bcdf3b2df5c05f2103aada445f791cb2a2e175b4.tar.gz smartsearch-bcdf3b2df5c05f2103aada445f791cb2a2e175b4.tar.bz2 smartsearch-bcdf3b2df5c05f2103aada445f791cb2a2e175b4.zip |
Fix Prevent issue
-rw-r--r--[-rwxr-xr-x] | data/images/B10_btn_icon_Phone.png | bin | 3470 -> 3330 bytes | |||
-rwxr-xr-x | src/ps_searcher.cpp | 30 | ||||
-rwxr-xr-x | src/smartsearch.cpp | 10 |
3 files changed, 25 insertions, 15 deletions
diff --git a/data/images/B10_btn_icon_Phone.png b/data/images/B10_btn_icon_Phone.png Binary files differindex 7292657..5e7b413 100755..100644 --- a/data/images/B10_btn_icon_Phone.png +++ b/data/images/B10_btn_icon_Phone.png 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) { |