Fix Prevent issue
authorJunghyun Kim <jh1114.kim@samsung.com>
Fri, 1 Feb 2013 06:50:25 +0000 (10:50 +0400)
committerJunghyun Kim <jh1114.kim@samsung.com>
Fri, 1 Feb 2013 06:50:25 +0000 (10:50 +0400)
data/images/B10_btn_icon_Phone.png [changed mode: 0755->0644]
src/ps_searcher.cpp
src/smartsearch.cpp

old mode 100755 (executable)
new mode 100644 (file)
index 7292657..5e7b413
Binary files a/data/images/B10_btn_icon_Phone.png and b/data/images/B10_btn_icon_Phone.png differ
index cfcb66f..ed43f30 100755 (executable)
@@ -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 {
index ef7bf45..a372238 100755 (executable)
@@ -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)
                        {