mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-28 14:44:39 +08:00
Fix memory leak of sdp list in the attribute client
This commit is contained in:
parent
43e7a91f82
commit
dbe7a78109
@ -44,15 +44,19 @@ static DBusConnection *connection;
|
||||
static int client_probe(struct btd_device *device, GSList *uuids)
|
||||
{
|
||||
const sdp_record_t *rec;
|
||||
sdp_list_t *list;
|
||||
int psm = -1;
|
||||
|
||||
rec = btd_device_get_record(device, GATT_UUID);
|
||||
if (rec) {
|
||||
sdp_list_t *list;
|
||||
if (sdp_get_access_protos(rec, &list) < 0)
|
||||
return -1;
|
||||
|
||||
psm = sdp_get_proto_port(list, L2CAP_UUID);
|
||||
|
||||
sdp_list_foreach(list, (sdp_list_func_t) sdp_list_free, NULL);
|
||||
sdp_list_free(list, NULL);
|
||||
|
||||
if (psm < 0)
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user