summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-03-20 20:01:06 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2008-03-20 20:01:06 +0000
commit2d66b88740c66d5d6b94d5fe8797c694a67bb0d4 (patch)
treefb1f973e7d01597266785902f7e13ead34335b19
parentd5dd4c0246576a171b1067ae098bb751c4f261c6 (diff)
Initialize error properly
-rw-r--r--hcid/agent.c5
1 files changed, 5 insertions, 0 deletions
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);
}