bt_gatt_common_s *common = (bt_gatt_common_s *)l->data;
uuid128_b = _bt_convert_uuid_to_uuid128(common->uuid);
- if (g_ascii_strcasecmp(uuid128_a, uuid128_b) == 0) {
+
+ if (uuid128_b == NULL) {
+ BT_ERR("__get_gatt_handle_by_uuid Error Parameter are NULL..\n");
+ continue;
+ } else if (g_ascii_strcasecmp(uuid128_a, uuid128_b) == 0) {
g_free(uuid128_b);
break;
}
for (l = gatt_client_list; l; l = g_slist_next(l)) {
bt_gatt_client_s *c = (bt_gatt_client_s *)l->data;
- if (!g_ascii_strcasecmp(c->remote_address, remote_address)) {
+ if ((c == NULL) || (c->remote_address == NULL)) {
+ BT_ERR("bt_gatt_client_create Error Parameter are NULL..\n");
+ continue;
+ } else if (!g_ascii_strcasecmp(c->remote_address, remote_address)) {
BT_ERR("Gatt client for %s is already created",
remote_address);
return BT_ERROR_ALREADY_DONE;
svc = (bt_gatt_service_s *)l->data;
for (ll = svc->characteristics; ll; ll = g_slist_next(ll)) {
chr = (bt_gatt_characteristic_s *)ll->data;
- if (g_ascii_strcasecmp(chr->path, char_path) == 0) {
+
+ if ((chr == NULL) || (chr->path == NULL)) {
+ BT_ERR("__value_changed_cb Error Parameter are NULL..\n");
+ continue;
+ } else if (g_ascii_strcasecmp(chr->path, char_path) == 0) {
if (chr->value_changed_cb)
chr->value_changed_cb(chr, value,
value_length,
for (l = otp_client_list; l; l = g_slist_next(l)) {
info = l->data;
-
- if (info && !g_ascii_strcasecmp(info->remote_address, remote_address))
+ if ((info == NULL) || (info->remote_address == NULL)) {
+ BT_ERR("_bt_otp_client_find Error Parameter are NULL..\n");
+ continue;
+ } else if (info && !g_ascii_strcasecmp(info->remote_address, remote_address)) {
return info;
+ }
}
return NULL;
}
for (l = otp_client_list; l; l = g_slist_next(l)) {
info = l->data;
- if (info && !g_ascii_strcasecmp(info->remote_address, remote_address)) {
+ if ((info == NULL) || (info->remote_address == NULL)) {
+ BT_ERR("bt_otp_client_create Error Parameter are NULL..\n");
+ continue;
+ } else if (info && !g_ascii_strcasecmp(info->remote_address, remote_address)) {
BT_ERR("OTP Client for Remote device [%s] is already created",
remote_address);
*otp_client = (bt_otp_client_h)info;
for (l = proximity_monitor_list; l; l = g_slist_next(l)) {
bt_proximity_monitor_s *c = (bt_proximity_monitor_s *)l->data;
- if (!g_ascii_strcasecmp(c->remote_address, remote_address))
+ if ((c == NULL) || (c->remote_address == NULL)) {
+ BT_ERR("_bt_proximity_monitor_find Error Parameter are NULL..\n");
+ continue;
+ } else if (!g_ascii_strcasecmp(c->remote_address, remote_address)) {
return c;
+ }
}
return NULL;
}
for (l = proximity_monitor_list; l; l = g_slist_next(l)) {
bt_proximity_monitor_s *c = (bt_proximity_monitor_s *)l->data;
- if (!g_ascii_strcasecmp(c->remote_address, remote_address)) {
+ if ((c == NULL) || (c->remote_address == NULL)) {
+ BT_ERR("bt_proximity_monitor_create Error Parameter are NULL..\n");
+ continue;
+ } else if (!g_ascii_strcasecmp(c->remote_address, remote_address)) {
BT_ERR("Gatt client for %s is already created",
remote_address);
return BT_ERROR_ALREADY_DONE;
for (l = tds_seeker_list; l; l = g_slist_next(l)) {
- if (!g_ascii_strcasecmp(((bt_tds_seeker_s *)l->data)->remote_address, remote_address))
+ if ((l == NULL) || (l->data == NULL) || (((bt_tds_seeker_s *)l->data)->remote_address == NULL)) {
+ BT_ERR("_bt_tds_seeker_find Error Parameter are NULL..\n");
+ continue;
+ } else if (!g_ascii_strcasecmp(((bt_tds_seeker_s *)l->data)->remote_address, remote_address)) {
return ((bt_tds_seeker_s *)l->data);
+ }
}
return NULL;
}
static void __bt_tds_reset_seeker_data(bt_tds_seeker_s *seeker)
{
- g_free((seeker)->remote_address);
- (seeker)->remote_address = NULL;
g_free((seeker)->tds_control_point);
(seeker)->tds_control_point = NULL;
for (l = tds_seeker_list; l; l = g_slist_next(l)) {
bt_tds_seeker_s *c = (bt_tds_seeker_s *)l->data;
- if (!g_ascii_strcasecmp(c->remote_address, remote_address)) {
+ if ((c == NULL) || ((c->remote_address == NULL))) {
+ BT_ERR("bt_tds_seeker_create Error Parameter are NULL..\n");
+ continue;
+ } else if (!g_ascii_strcasecmp(c->remote_address, remote_address)) {
BT_ERR("TDS Seeker for Remote Provider [%s] is already created",
remote_address);
*seeker = (bt_tds_seeker_h)c;