From: Abhishek Chandra Date: Wed, 21 Mar 2018 08:34:53 +0000 (+0530) Subject: [Bluetooth]SVACE issue fixed for WGID : X-Git-Tag: submit/tizen/20180322.062553~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4390c38fde13e3e9fa2af71fdad5b82b3a88ba82;p=platform%2Fcore%2Fapi%2Fbluetooth.git [Bluetooth]SVACE issue fixed for WGID : - 305910 - 305912 Change-Id: I6191e8f9c70c0b31290986429d0e9f2ac2b4756a Signed-off-by: Abhishek Chandra --- diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c index f579673..83127a0 100644 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -1331,10 +1331,12 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us break; case BLUETOOTH_EVENT_DEVICE_DISCONNECTED: BT_INFO("bt_device_connection_state_changed_cb() will be called"); - __bt_get_bt_device_connection_info_s(&conn_info, (bt_connection_info_t *)(param->param_data)); - ((bt_device_connection_state_changed_cb)bt_event_slot_container[event_index].callback) - (false, conn_info, bt_event_slot_container[event_index].user_data); - __bt_free_bt_device_connection_info_s(conn_info); + if (__bt_get_bt_device_connection_info_s(&conn_info, (bt_connection_info_t *)(param->param_data)) + == BT_ERROR_NONE) { + ((bt_device_connection_state_changed_cb)bt_event_slot_container[event_index].callback) + (false, conn_info, bt_event_slot_container[event_index].user_data); + __bt_free_bt_device_connection_info_s(conn_info); + } break; case BLUETOOTH_EVENT_RSSI_ENABLED: BT_INFO("bt_rssi_monitor_enabled_cb() will be called"); @@ -1393,11 +1395,12 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us if (error_code == BT_ERROR_OPERATION_FAILED) error_code = BT_ERROR_SERVICE_SEARCH_FAILED; - __bt_get_bt_device_sdp_info_s(&sdp_info, (bt_sdp_info_t *)(param->param_data), error_code); - - ((bt_device_service_searched_cb)bt_event_slot_container[event_index].callback) - (error_code, sdp_info, bt_event_slot_container[event_index].user_data); - __bt_free_bt_device_sdp_info_s(sdp_info); + if (__bt_get_bt_device_sdp_info_s(&sdp_info, (bt_sdp_info_t *)(param->param_data), error_code) + == BT_ERROR_NONE) { + ((bt_device_service_searched_cb)bt_event_slot_container[event_index].callback) + (error_code, sdp_info, bt_event_slot_container[event_index].user_data); + __bt_free_bt_device_sdp_info_s(sdp_info); + } break; case BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED: /* BT_INFO("bt_socket_data_received_cb() will be * called"); */