diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2018-02-06 07:00:14 -0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2018-02-06 09:54:13 -0200 |
commit | 0e260e458c155654524ec76163ece3f65a8d4f9f (patch) | |
tree | 1e2aa716800da1e93bc0103ca0de7f4a9073fd4e /src/gatt-client.c | |
parent | dfb579e50973d6499ebdc0ecc64e347b9064fb97 (diff) | |
download | bluez-0e260e458c155654524ec76163ece3f65a8d4f9f.tar.gz |
gatt: Fix memory leak
If bt_gatt_client_register_notify fails the client shall be freed.
Diffstat (limited to 'src/gatt-client.c')
-rw-r--r-- | src/gatt-client.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gatt-client.c b/src/gatt-client.c index 2f01867dc..d3b699d6a 100644 --- a/src/gatt-client.c +++ b/src/gatt-client.c @@ -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); |