From 081d9d1df3cde11e3e3833201f4cadac6f355da0 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 29 Jul 2008 15:39:47 -0300 Subject: Fix problem of missing record on sdp cache which turn to include a NULL pointer as a valid record. --- src/device.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/device.c b/src/device.c index 9d9e03b8..45137d65 100644 --- a/src/device.c +++ b/src/device.c @@ -631,13 +631,17 @@ void device_probe_drivers(struct btd_device *device, GSList *uuids, sdp_list_t * GSList *records = NULL; for (uuid = driver->uuids; *uuid; uuid++) { - GSList *match = g_slist_find_custom(uuids, *uuid, - (GCompareFunc) strcasecmp); - if (match) { - sdp_record_t *rec = get_record(recs, *uuid); + sdp_record_t *rec; - records = g_slist_append(records, rec); - } + if (!g_slist_find_custom(uuids, *uuid, + (GCompareFunc) strcasecmp)) + continue; + + rec = get_record(recs, *uuid); + if (!rec) + continue; + + records = g_slist_append(records, rec); } if (records) { -- cgit