summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-09-25 22:57:36 -0700
committerJohan Hedberg <johan.hedberg@nokia.com>2008-09-25 22:57:36 -0700
commitd0c0409d8ad37a042539706ff5382899acc81395 (patch)
tree98831bc304d17189a460413bae5a69843dfd361d
parent68b27e68b50b1e68d663142d2b0432c435329ea6 (diff)
Only create D-Bus client listener if there is a client
-rw-r--r--src/device.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/device.c b/src/device.c
index 00589006..59e48904 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1172,13 +1172,16 @@ int device_browse(struct btd_device *device, DBusConnection *conn,
}
device->discov_active = 1;
- device->discov_requestor = g_strdup(dbus_message_get_sender(msg));
- /* Track the request owner to cancel it
- * automatically if the owner exits */
- device->discov_listener = g_dbus_add_disconnect_watch(conn,
+
+ if (msg) {
+ device->discov_requestor = g_strdup(dbus_message_get_sender(msg));
+ /* Track the request owner to cancel it
+ * automatically if the owner exits */
+ device->discov_listener = g_dbus_add_disconnect_watch(conn,
dbus_message_get_sender(msg),
discover_services_req_exit,
device, NULL);
+ }
return bt_search_service(&src, &device->bdaddr,
&uuid, cb, req, NULL);