Diff between d21b8db341ccd407556f44460e12947d9b31c2ed and 02c7e754d77678945ca8140accd94800d64a4ad7

Changed Files

File Additions Deletions Status
src/shared/gatt-client.c +5 -1 modified

Full Patch

diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 1f82048..cf93d4b 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -993,6 +993,10 @@ static void service_changed_complete(struct discovery_op *op, bool success,
 	service_list_insert_services(&client->svc_head, &client->svc_tail,
 					op->result_head, op->result_tail);
 
+	/* Relinquish ownership of services, as the client now owns them */
+	op->result_head = NULL;
+	op->result_tail = NULL;
+
 next:
 	/* Notify the upper layer of changed services */
 	if (client->svc_chngd_callback)
@@ -1155,7 +1159,7 @@ static void init_complete(struct discovery_op *op, bool success,
 	client->svc_head = op->result_head;
 	client->svc_tail = op->result_tail;
 
-	/* Change owner of service list */
+	/* Relinquish ownership of services, as the client now owns them */
 	op->result_head = NULL;
 	op->result_tail = NULL;