Skip to content

Commit

Permalink
shared/micp: Fix memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
maheshtalewad authored and Vudentz committed Oct 5, 2023
1 parent b88e660 commit 0a74963
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/shared/micp.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ void bt_micp_detach(struct bt_micp *micp)
if (!queue_remove(sessions, micp))
return;

bt_gatt_client_idle_unregister(micp->client, micp->idle_id);
bt_gatt_client_unref(micp->client);
micp->client = NULL;

Expand Down Expand Up @@ -175,6 +176,7 @@ static void micp_free(void *data)

micp_db_free(micp->rdb);

queue_destroy(micp->notify, free);
queue_destroy(micp->pending, NULL);
queue_destroy(micp->ready_cbs, micp_ready_free);

Expand Down Expand Up @@ -594,6 +596,7 @@ struct bt_micp *bt_micp_new(struct gatt_db *ldb, struct gatt_db *rdb)
micp->ldb = mdb;
micp->pending = queue_new();
micp->ready_cbs = queue_new();
micp->notify = queue_new();

if (!rdb)
goto done;
Expand Down

0 comments on commit 0a74963

Please sign in to comment.