summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-adapter.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-08-23 08:01:01 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-08-23 08:01:01 +0000
commitaf866cd31726b39c572617d4b479ba78a33b71a3 (patch)
tree982e92975375879803d48e64270ec581fffe05ce /hcid/dbus-adapter.c
parenteb0accc1d7f15faf4a992cb3a07f917e4769c711 (diff)
Get rid of redundant pdata->bonding_requestor
Diffstat (limited to 'hcid/dbus-adapter.c')
-rw-r--r--hcid/dbus-adapter.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c
index 3e06d50e..54ee49ab 100644
--- a/hcid/dbus-adapter.c
+++ b/hcid/dbus-adapter.c
@@ -1781,9 +1781,7 @@ static DBusHandlerResult handle_dev_create_bonding_req(DBusConnection *conn, DBu
dbus_data->bonding->disconnect = disconnect;
dbus_data->bonding->rq = dbus_message_ref(msg);
- dbus_data->bonding_requestor = strdup(dbus_message_get_sender(msg));
-
- name_listener_add(conn, dbus_data->bonding_requestor,
+ name_listener_add(conn, dbus_message_get_sender(msg),
(name_cb_t)create_bond_req_exit, dbus_data);
hci_close_dev(dd);
@@ -1826,8 +1824,7 @@ static DBusHandlerResult handle_dev_cancel_bonding_req(DBusConnection *conn, DBu
return error_bonding_not_in_progress(conn, msg);
}
- if (!dbus_data->bonding_requestor || strcmp(dbus_data->bonding_requestor,
- dbus_message_get_sender(msg)))
+ if (strcmp(dbus_message_get_sender(dbus_data->bonding->rq), dbus_message_get_sender(msg)))
return error_not_authorized(conn, msg);
dd = hci_open_dev(dbus_data->dev_id);
@@ -1881,10 +1878,8 @@ static DBusHandlerResult handle_dev_cancel_bonding_req(DBusConnection *conn, DBu
/* Reply to the create bonding request */
error_authentication_canceled(conn, dbus_data->bonding->rq);
- name_listener_remove(conn, dbus_data->bonding_requestor,
+ name_listener_remove(conn, dbus_message_get_sender(dbus_data->bonding->rq),
(name_cb_t)create_bond_req_exit, dbus_data);
- free(dbus_data->bonding_requestor);
- dbus_data->bonding_requestor = NULL;
/* disconnect from the remote device */
if (dbus_data->bonding->disconnect) {