diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-11-08 15:57:00 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-11-08 15:57:00 +0200 |
commit | cdfe8a8246013031f55c647092e41adbb29ace81 (patch) | |
tree | 1c067c0dd008ab400f0a1040f2b4e5f8bc178431 | |
parent | 3bb7c1527ce3ec67127200b54a8fbc01a196ebad (diff) |
Fix memory leak
-rw-r--r-- | src/device.c | 8 |
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; } |