From cdfe8a8246013031f55c647092e41adbb29ace81 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sat, 8 Nov 2008 15:57:00 +0200 Subject: Fix memory leak --- src/device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/device.c') diff --git a/src/device.c b/src/device.c index 82558567..b3300061 100644 --- a/src/device.c +++ b/src/device.c @@ -625,11 +625,11 @@ static GSList *device_match_pattern(struct btd_device *device, GSList *profiles) { GSList *l, *uuids = NULL; - GSList *patterns = NULL; for (l = profiles; l; l = l->next) { const char *uuid = l->data; const sdp_record_t *rec; + GSList *patterns; rec = btd_device_get_record(device, uuid); @@ -641,10 +641,10 @@ static GSList *device_match_pattern(struct btd_device *device, if (g_slist_find_custom(patterns, pattern, (GCompareFunc) strcasecmp)) uuids = g_slist_append(uuids, uuid); - } - g_slist_foreach(patterns, (GFunc) g_free, NULL); - g_slist_free(patterns); + g_slist_foreach(patterns, (GFunc) g_free, NULL); + g_slist_free(patterns); + } return uuids; } -- cgit