diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 4b3f553..8083ff7 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
bool bt_gatt_client_ready_unregister(struct bt_gatt_client *client,
unsigned int id)
{
- return queue_remove(client->ready_cbs, UINT_TO_PTR(id));
+ struct ready_cb *ready = UINT_TO_PTR(id);
+
+ if (queue_remove(client->ready_cbs, ready)) {
+ ready_destroy(ready);
+ return true;
+ }
+
+ return false;
}
bool bt_gatt_client_set_service_changed(struct bt_gatt_client *client,