mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-15 08:14:28 +08:00
gatt: Fix memory leak
If bt_gatt_client_register_notify fails the client shall be freed.
This commit is contained in:
parent
dfb579e509
commit
0e260e458c
@ -1492,8 +1492,10 @@ static DBusMessage *characteristic_acquire_notify(DBusConnection *conn,
|
||||
register_notify_io_cb,
|
||||
notify_io_cb,
|
||||
client, NULL);
|
||||
if (!client->notify_id)
|
||||
if (!client->notify_id) {
|
||||
notify_client_unref(client);
|
||||
return btd_error_failed(msg, "Failed to subscribe");
|
||||
}
|
||||
|
||||
queue_push_tail(chrc->notify_clients, client);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user