diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2012-12-05 14:57:46 +0100 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-12-05 16:50:37 +0200 |
commit | 68851e84a6f2a636bc9f8d0d123e72f59bed8bfe (patch) | |
tree | a7b7890ad55b74530b8cf0fed8fc889f4dd517ea /src/session.c | |
parent | a4ae4deec646cd18092a43400392a83704227620 (diff) | |
download | connman-68851e84a6f2a636bc9f8d0d123e72f59bed8bfe.tar.gz connman-68851e84a6f2a636bc9f8d0d123e72f59bed8bfe.tar.bz2 connman-68851e84a6f2a636bc9f8d0d123e72f59bed8bfe.zip |
session: Fix error case handling
There is no need to unref the pending message, because in all
cases we generate a reply message which takes care of unrefing
the message. Hence the dbus_message_unref() is not needed.
Furthermore, we need to pass the created error message to the bus
via g_dbus_send_message() so that the client gets always a response.
Diffstat (limited to 'src/session.c')
-rw-r--r-- | src/session.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/session.c b/src/session.c index 3273c673..7ffeedc3 100644 --- a/src/session.c +++ b/src/session.c @@ -1689,11 +1689,12 @@ static void session_create_cb(struct connman_session *session, out: if (err < 0) { - __connman_error_failed(user_config->pending, -err); + reply = __connman_error_failed(user_config->pending, -err); + g_dbus_send_message(connection, reply); + free_session(session); } - dbus_message_unref(user_config->pending); g_free(user_config); } |