Skip to contentSkip to conversation

core/device: Fix memory leak

PATCH New Luiz Augusto von Dentz 1 participant 1 message Apr 9, 2015 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 core/device: Fix memory leak

From: Luiz Augusto von Dentz <[email protected]>

btd_device_connect_services should not reference the services given as pending list handling does not unreference them.

---
 src/device.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
src/device.c +1 -2
index 6e6c9ee..d4360e6 100644
@@ -1520,8 +1520,7 @@ int btd_device_connect_services(struct btd_device *dev, GSList *services)
 	for (l = services; l; l = g_slist_next(l)) {
 		struct btd_service *service = l->data;
 
-		dev->pending = g_slist_append(dev->pending,
-						btd_service_ref(service));
+		dev->pending = g_slist_append(dev->pending, service);
 	}
 
 	return connect_next(dev);
Signature · 1 line
2.1.0