From aaf0f75d2a18a86bca3c418ddd63e936627c4446 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 25 Sep 2008 19:53:36 -0700 Subject: Fix another memory leak --- src/device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index c998eb09..82a90e05 100644 --- a/src/device.c +++ b/src/device.c @@ -880,8 +880,10 @@ static void update_services(struct browse_req *req, sdp_list_t *recs) /* Extract the first element and skip the remainning */ uuid_str = bt_uuid2string(svcclass->data); - if (!uuid_str) + if (!uuid_str) { + sdp_list_free(svcclass, free); continue; + } if (!strcasecmp(uuid_str, PNP_UUID)) { uint16_t source, vendor, product, version; @@ -917,6 +919,7 @@ static void update_services(struct browse_req *req, sdp_list_t *recs) /* Check for duplicates */ if (sdp_list_find(req->records, rec, rec_cmp)) { g_free(uuid_str); + sdp_list_free(svcclass, free); continue; } -- cgit