[Bluetooth]SVACE issue fixed for WGID : 18/173418/1
authorAbhishek Chandra <abhishek.ch@samsung.com>
Wed, 21 Mar 2018 08:34:53 +0000 (14:04 +0530)
committerAbhishek Chandra <abhishek.ch@samsung.com>
Wed, 21 Mar 2018 09:02:40 +0000 (14:32 +0530)
- 305910
- 305912

Change-Id: I6191e8f9c70c0b31290986429d0e9f2ac2b4756a
Signed-off-by: Abhishek Chandra <abhishek.ch@samsung.com>
src/bluetooth-common.c

index f579673baa8535170be915fffae69312576c6574..83127a0760cbf8689914369757a24641b4f09938 100644 (file)
@@ -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"); */