summaryrefslogtreecommitdiffstats
path: root/hcid/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/device.c')
-rw-r--r--hcid/device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hcid/device.c b/hcid/device.c
index 1a0840e5..1e80b51e 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -60,6 +60,7 @@
#include "dbus-hci.h"
#include "error.h"
#include "glib-helper.h"
+#include "agent.h"
#define MAX_DEVICES 16
@@ -737,6 +738,8 @@ int get_encryption_key_size(uint16_t dev_id, const bdaddr_t *baddr)
static void device_free(struct device *device)
{
+ if (device->agent)
+ agent_destroy(device->agent, FALSE);
g_slist_foreach(device->uuids, (GFunc) g_free, NULL);
g_slist_free(device->uuids);
g_free(device->address);