summaryrefslogtreecommitdiffstats
path: root/hcid/device.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-04-14 18:22:50 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-04-14 18:22:50 +0000
commit7b67507336f98dda5523902806dd2e33684fab6b (patch)
tree0c57c149e2b89b211abee60f12d6a598969c60e1 /hcid/device.c
parent9a8e48550668c6da7917a83c99c9ce4bbfdbfc6b (diff)
Fix bug that happen when sdp discovery fails no reply is send.
Diffstat (limited to 'hcid/device.c')
-rw-r--r--hcid/device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hcid/device.c b/hcid/device.c
index 1e80b51e..4f9dcdf9 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -1070,7 +1070,7 @@ static void browse_cb(gpointer user_data, sdp_list_t *recs, int err)
DBusMessage *reply;
if (err < 0)
- return;
+ goto proceed;
for (seq = recs; seq; seq = next) {
sdp_record_t *rec = (sdp_record_t *) seq->data;
@@ -1117,6 +1117,7 @@ static void browse_cb(gpointer user_data, sdp_list_t *recs, int err)
DBUS_TYPE_ARRAY, &uuids);
g_free(uuids);
+proceed:
dbus_connection_emit_signal(req->conn, dbus_message_get_path(req->msg),
ADAPTER_INTERFACE, "DeviceCreated",
DBUS_TYPE_OBJECT_PATH, &device->path,
@@ -1125,13 +1126,14 @@ static void browse_cb(gpointer user_data, sdp_list_t *recs, int err)
/* Reply create device request */
reply = dbus_message_new_method_return(req->msg);
if (!reply)
- return;
+ goto fail;
dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &device->path,
DBUS_TYPE_INVALID);
send_message_and_unref(req->conn, reply);
+fail:
dbus_message_unref(req->msg);
dbus_connection_unref(req->conn);
g_free(req);