From 823272a38d89ec5d092f579951a921cee18afd73 Mon Sep 17 00:00:00 2001 From: "yumi82.ko" Date: Thu, 10 Jan 2013 16:59:10 +0900 Subject: fix prevent defect. 38150, 23538 Change-Id: I0a1cead50ced103f702afac43d38dfd0e76ddc46 --- thread/src/msg-ui-thread-list.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'thread/src') diff --git a/thread/src/msg-ui-thread-list.c b/thread/src/msg-ui-thread-list.c index 5dcfc50..1f32033 100755 --- a/thread/src/msg-ui-thread-list.c +++ b/thread/src/msg-ui-thread-list.c @@ -394,6 +394,7 @@ static void __msg_ui_thread_gl_sel(void *data, Evas_Object *obj, void *event_inf err = msg_get_message_list(msg_ui_thread_get_data_handle(), MSG_DRAFT_ID, item_data->thread_id, 0, MSG_STORAGE_PHONE, &draft_list); if (err != MSG_SUCCESS) { MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "msg_get_message_list() is failed = %d", err); + service_destroy(svc_handle); return; } @@ -1533,11 +1534,14 @@ Eina_Bool msg_ui_thread_list_msg_item_update(PMSG_THREAD_LIST_DATA pListData, ms msg_release_struct(&sendOpt); msg_ui_thread_list_item_update(pListData, thread_id); - if (search_str) - free(search_str); - msg_release_struct(&search_s); - return EINA_TRUE; } + + if (search_str) { + free(search_str); + search_str = NULL; + } + msg_release_struct(&search_s); + return EINA_TRUE; } MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Search string word = [%s] ", search_str); @@ -1558,12 +1562,17 @@ Eina_Bool msg_ui_thread_list_msg_item_update(PMSG_THREAD_LIST_DATA pListData, ms break; default: D_MSG("[WARNING] invalid view mode"); + if (search_str) { + free(search_str); + search_str = NULL; + } return EINA_FALSE; } msg_set_str_value(search_s, MSG_SEARCH_CONDITION_SEARCH_VALUE_STR, search_str, strlen(search_str)); err = msg_search_message(pData->msgHandle, search_s, 0, 0, &msg_list); free(search_str); + search_str = NULL; msg_release_struct(&search_s); MSG_UI_RETV_IF(MSG_UI_LEVEL_DEBUG, err != MSG_SUCCESS, EINA_FALSE); -- cgit v1.2.3