dev = _bt_main_create_searched_le_device_item((void *)info);
if (NULL == dev) {
BT_ERR("Create new device item failed");
+ g_free(remote_name);
return;
}
if (_bt_main_add_searched_device(ugd, dev) == NULL) {
BT_ERR("Fail to add the searched device");
+ g_free(remote_name);
return;
}
eina_list_append(ugd->searched_device, dev);
}
+ g_free(remote_name);
FN_END;
}
return NULL;
}
- if (strlen(remote_name) == 0)
+ if (!remote_name || strlen(remote_name) == 0)
return NULL;
/* only HOG Device will be shown in searched list */
BT_DBG("UUID[%d] = %s", i + 1, uuids[i]);
if (g_strcmp0(HOGP_SERVICE_UUID, uuids[i]) == 0)
is_hog++;
-
+ g_free(uuids[i]);
}
+ g_free(uuids);
} else
BT_ERR("Fail to get LE service uuids");
- if (!is_hog)
+ if (!is_hog) {
+ g_free(remote_name);
return NULL;
+ }
dev = calloc(1, sizeof(bt_dev_t));
retv_if(dev == NULL, NULL);
dev->bd_addr[1], dev->bd_addr[2], dev->bd_addr[3],
dev->bd_addr[4], dev->bd_addr[5]);
+ g_free(remote_name);
FN_END;
return dev;
}