summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-29 15:39:47 -0300
committerLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-29 15:39:47 -0300
commit081d9d1df3cde11e3e3833201f4cadac6f355da0 (patch)
tree90e444b551d453aa46c4a9058a2878abb982e5e1 /src
parente0581b5e29c71c4a0b429ebad671e9bb5583f8e0 (diff)
Fix problem of missing record on sdp cache which turn to include a NULL pointer as a valid record.
Diffstat (limited to 'src')
-rw-r--r--src/device.c16
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) {