From 2d66b88740c66d5d6b94d5fe8797c694a67bb0d4 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 20 Mar 2008 20:01:06 +0000 Subject: Initialize error properly --- hcid/agent.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hcid/agent.c b/hcid/agent.c index edd8cf05..fca002c2 100644 --- a/hcid/agent.c +++ b/hcid/agent.c @@ -112,6 +112,9 @@ static void agent_free(struct agent *agent) if (agent->request) { DBusError err; + dbus_error_init(&err); + dbus_set_error_const(&err, "org.bluez.Error.Failed", "Canceled"); + if (agent->request->type == AGENT_REQUEST_PASSKEY) { agent_passkey_cb cb = agent->request->cb; cb(agent, &err, NULL, agent->request->user_data); @@ -120,6 +123,8 @@ static void agent_free(struct agent *agent) cb(agent, &err, agent->request->user_data); } + dbus_error_free(&err); + send_cancel_request(agent->request); } -- cgit