diff options
| -rw-r--r-- | src/device.c | 16 | 
1 files changed, 10 insertions, 6 deletions
| 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) { | 
