static void __bt_tds_reset_seeker_data(bt_tds_seeker_s *seeker)
{
+ if ((seeker)->remote_address) {
+ g_free((seeker)->remote_address);
+ (seeker)->remote_address = NULL;
+ }
+
if ((seeker)->tds_control_point) {
g_free((seeker)->tds_control_point);
(seeker)->tds_control_point = NULL;
if (seeker_s->connected == true) {
error_code = __bt_update_tds_transport_data(&addr_hex, seeker_s);
if (error_code != BLUETOOTH_ERROR_NONE) {
+ __bt_tds_reset_seeker_data(seeker_s);
g_free(seeker_s);
return BT_ERROR_OPERATION_FAILED;
}
error_code = bluetooth_gatt_set_service_change_watcher(&addr_hex, true);
if (error_code != BLUETOOTH_ERROR_NONE) {
+ __bt_tds_reset_seeker_data(seeker_s);
g_free(seeker_s);
return BT_ERROR_OPERATION_FAILED;
}
seeker_s->remote_address = g_strdup(remote_address);
if (seeker_s->remote_address == NULL) {
+ __bt_tds_reset_seeker_data(seeker_s);
free(seeker_s);
error_code = BT_ERROR_OUT_OF_MEMORY;
BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);