From d3d71b89e832dbbcdd6c6b0ef56c131360ead044 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Tue, 6 Dec 2016 17:37:22 +0900 Subject: [PATCH] Fix the svace issues Change-Id: I6a552f8f05c951c6855460ea30b8e33eb5be0e55 Signed-off-by: DoHyun Pyun --- bt-share/src/obex-event-handler.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/bt-share/src/obex-event-handler.c b/bt-share/src/obex-event-handler.c index 356d52d..f72d8e2 100644 --- a/bt-share/src/obex-event-handler.c +++ b/bt-share/src/obex-event-handler.c @@ -591,6 +591,8 @@ void _bt_share_event_handler(int event, bluetooth_event_param_t *param, } case BLUETOOTH_EVENT_OPC_CONNECTED: { INFO("BLUETOOTH_EVENT_OPC_CONNECTED, result [%d]", param->result); + ret_if(node == NULL); + send_index = 0; is_started = FALSE; is_tr_wait = true; @@ -624,7 +626,7 @@ void _bt_share_event_handler(int event, bluetooth_event_param_t *param, if (param->result != BLUETOOTH_ERROR_NONE) { _bt_create_warning_popup(param->result, BT_STR_UNABLE_TO_SEND); - if (node != NULL && node->file_cnt > send_index) { + if (node->file_cnt > send_index) { int *uids; int uid_cnt = 0; @@ -678,21 +680,20 @@ void _bt_share_event_handler(int event, bluetooth_event_param_t *param, } } else { - if (node) { - _bt_insert_instant_notification(BT_SENDING_NOTI); + _bt_insert_instant_notification(BT_SENDING_NOTI); - if (ad->opc_noti) { - _bt_delete_notification(ad->opc_noti); - ad->opc_noti = NULL; - ad->opc_noti_id = 0; - } - - noti = _bt_insert_notification(ad, - BT_SENDING_NOTI, node->name, - node->addr, info->db_sid); - ad->opc_noti = noti; - ad->opc_noti_id = _bt_get_notification_priv_id(noti); + if (ad->opc_noti) { + _bt_delete_notification(ad->opc_noti); + ad->opc_noti = NULL; + ad->opc_noti_id = 0; } + + noti = _bt_insert_notification(ad, + BT_SENDING_NOTI, node->name, + node->addr, info->db_sid); + ad->opc_noti = noti; + ad->opc_noti_id = _bt_get_notification_priv_id(noti); + _bt_share_block_sleep(TRUE); _bt_set_transfer_indicator(TRUE); } @@ -753,6 +754,7 @@ void _bt_share_event_handler(int event, bluetooth_event_param_t *param, case BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS: { client_info = (bt_opc_transfer_info_t *)param->param_data; ret_if(client_info == NULL); + ret_if(node == NULL); percentage = client_info->percentage; name = strrchr(client_info->filename, '/'); @@ -783,6 +785,7 @@ void _bt_share_event_handler(int event, bluetooth_event_param_t *param, case BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE: { INFO("BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE"); + ret_if(node == NULL); if (!is_started) { INFO("TRANSFER operation abnormal. It is completed without TRANSFER START"); -- 2.7.4