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.
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);
}