diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index efc013a..5de679c 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
struct bt_gatt_client *client = user_data;
struct value_data data;
- if (queue_isempty(client->notify_list))
- return;
-
bt_gatt_client_ref(client);
+ if (queue_isempty(client->notify_list))
+ goto done;
+
memset(&data, 0, sizeof(data));
if (opcode == BT_ATT_OP_HANDLE_NFY_MULT) {
queue_foreach(client->notify_list, notify_handler, &data);
}
+done:
if (opcode == BT_ATT_OP_HANDLE_IND && !client->parent)
bt_att_chan_send(chan, BT_ATT_OP_HANDLE_CONF, NULL, 0,
NULL, NULL, NULL);