summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-security.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-03-13 21:26:30 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-03-13 21:26:30 +0000
commit49873571bb476f8ad9fdb818cab2d10c2b3b5d64 (patch)
tree371203b97d3a5521b2f4c07e0372467c9bd8c19a /hcid/dbus-security.c
parentb11a5563150e855143cb1b78066e7fa96ebca08c (diff)
Fix free'd memory access in UnregisterPasskeyAgent method
Diffstat (limited to 'hcid/dbus-security.c')
-rw-r--r--hcid/dbus-security.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hcid/dbus-security.c b/hcid/dbus-security.c
index 7fe9e313..6b1446cd 100644
--- a/hcid/dbus-security.c
+++ b/hcid/dbus-security.c
@@ -190,7 +190,7 @@ static DBusHandlerResult unregister_agent(DBusConnection *conn,
char *path, *addr;
struct hci_dbus_data *adapter;
struct slist *match;
- struct passkey_agent ref;
+ struct passkey_agent ref, *agent;
DBusMessage *reply;
if (!data) {
@@ -214,8 +214,10 @@ static DBusHandlerResult unregister_agent(DBusConnection *conn,
if (!match)
return error_passkey_agent_does_not_exist(conn, msg);
- adapter->passkey_agents = slist_remove(adapter->passkey_agents, match->data);
- passkey_agent_free(match->data);
+ agent = match->data;
+
+ adapter->passkey_agents = slist_remove(adapter->passkey_agents, agent);
+ passkey_agent_free(agent);
reply = dbus_message_new_method_return(msg);
if (!reply)