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;
/* 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();
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);
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 {