((bt_adapter_authentication_req_cb)bt_event_slot_container[event_index].callback)
(_bt_get_error_code(param->result), BT_AUTH_KEYBOARD_PASSKEY_DISPLAY, auth_information->device_name.name,
device_addr, auth_information->str_passkey, bt_event_slot_container[event_index].user_data);
+
+ if (device_addr != NULL)
+ free(device_addr);
break;
case BLUETOOTH_EVENT_PIN_REQUEST:
BT_INFO("bt_adapter_authentication_req_cb() will be called with \
((bt_adapter_authentication_req_cb)bt_event_slot_container[event_index].callback)
(_bt_get_error_code(param->result), BT_AUTH_PIN_REQUEST, auth_information->device_name.name, device_addr,
auth_information->str_passkey, bt_event_slot_container[event_index].user_data);
+
+ if (device_addr != NULL)
+ free(device_addr);
break;
case BLUETOOTH_EVENT_PASSKEY_REQUEST:
BT_INFO("bt_adapter_authentication_req_cb will be called with \
((bt_adapter_authentication_req_cb)bt_event_slot_container[event_index].callback)
(_bt_get_error_code(param->result), BT_AUTH_PIN_REQUEST, auth_information->device_name.name, device_addr,
auth_information->str_passkey, bt_event_slot_container[event_index].user_data);
+
+ if (device_addr != NULL)
+ free(device_addr);
break;
case BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST:
BT_INFO("bt_adapter_authentication_req_cb will be called with \
((bt_adapter_authentication_req_cb)bt_event_slot_container[event_index].callback)
(_bt_get_error_code(param->result), BT_AUTH_PASSKEY_CONFIRM_REQUEST, auth_information->device_name.name, device_addr,
auth_information->str_passkey, bt_event_slot_container[event_index].user_data);
+
+ if (device_addr != NULL)
+ free(device_addr);
break;
case BLUETOOTH_EVENT_DEVICE_AUTHORIZED:
BT_INFO("bt_device_authorization_changed_cb() will be called with BT_DEVICE_AUTHORIZED");
((bt_map_client_list_folders_cb)bt_event_slot_container[event_index].callback)
(param->result, folders_struct->names, folders_struct->size,
bt_event_slot_container[event_index].user_data);
-
- if (device_addr != NULL)
- free(device_addr);
break;
case BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE:
((bt_map_client_list_filter_fields_cb)bt_event_slot_container[event_index].callback)
(param->result, fields_info->fields, fields_info->size,
bt_event_slot_container[event_index].user_data);
-
- if (device_addr != NULL)
- free(device_addr);
}
break;
((bt_hid_device_connection_state_changed_cb)bt_event_slot_container[event_index].callback)
(_bt_get_error_code(param->result), TRUE, device_addr, bt_event_slot_container[event_index].user_data);
- g_free(device_addr);
+ if (device_addr != NULL)
+ free(device_addr);
break;
case BLUETOOTH_HID_DEVICE_DISCONNECTED:
BT_INFO("BLUETOOTH_HID_DEVICE_DISCONNECTED");
((bt_hid_device_connection_state_changed_cb)bt_event_slot_container[event_index].callback)
(_bt_get_error_code(param->result), FALSE, device_addr, bt_event_slot_container[event_index].user_data);
- g_free(device_addr);
+ if (device_addr != NULL)
+ free(device_addr);
break;
case BLUETOOTH_HID_DEVICE_DATA_RECEIVED:
BT_INFO("HID Device Data");
/* OTP Client */
_bt_otp_client_connection_state_changed(param->result, device_addr, TRUE);
- g_free(device_addr);
+ if (device_addr != NULL)
+ free(device_addr);
device_addr = NULL;
break;
}
/* OTP Client */
_bt_otp_client_connection_state_changed(param->result, device_addr, FALSE);
- g_free(device_addr);
+ if (device_addr != NULL)
+ free(device_addr);
device_addr = NULL;
break;
}
BLUETOOTH_ERROR_INTERNAL, NULL, 0);
BT_INFO("GATT Server: Internal response sent for Read Request");
+ if (device_addr != NULL)
+ free(device_addr);
return;
}
_bt_otp_check_service_changed(device_addr, service_change);
client = _bt_gatt_get_client(device_addr);
- g_free(device_addr);
+ if (device_addr != NULL)
+ free(device_addr);
device_addr = NULL;
if (client == NULL) {
BT_INFO("BLUETOOTH_EVENT_IPSP_CONNECTED");
bt_ipsp_iface_info = (bt_ipsp_connection_info_t *)(param->param_data);
_bt_convert_address_to_string(&device_addr, &bt_ipsp_iface_info->btaddr);
+
((bt_ipsp_connection_state_changed_cb)bt_event_slot_container[event_index].callback)
(_bt_get_error_code(param->result), TRUE, device_addr, bt_ipsp_iface_info->if_name,
bt_event_slot_container[event_index].user_data);
+
+ if (device_addr != NULL)
+ free(device_addr);
break;
case BLUETOOTH_EVENT_IPSP_DISCONNECTED:
BT_INFO("BLUETOOTH_EVENT_IPSP_DISCONNECTED");
bt_ipsp_iface_info = (bt_ipsp_connection_info_t *)(param->param_data);
_bt_convert_address_to_string(&device_addr, &bt_ipsp_iface_info->btaddr);
+
((bt_ipsp_connection_state_changed_cb)bt_event_slot_container[event_index].callback)
(_bt_get_error_code(param->result), FALSE, device_addr, bt_ipsp_iface_info->if_name,
bt_event_slot_container[event_index].user_data);
+
+ if (device_addr != NULL)
+ free(device_addr);
break;
case BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED: {
bt_gatt_client_att_mtu_info_s *mtu_info = NULL;