summaryrefslogtreecommitdiffstats
path: root/src/device.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-11-08 15:57:00 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-11-08 15:57:00 +0200
commitcdfe8a8246013031f55c647092e41adbb29ace81 (patch)
tree1c067c0dd008ab400f0a1040f2b4e5f8bc178431 /src/device.c
parent3bb7c1527ce3ec67127200b54a8fbc01a196ebad (diff)
Fix memory leak
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c8
1 files changed, 4 insertions, 4 deletions
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;
}