diff options
Diffstat (limited to 'hcid/dbus-adapter.c')
-rw-r--r-- | hcid/dbus-adapter.c | 11 |
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) { |