From: Patrik Flykt <[email protected]>
---
src/agent.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/agent.c b/src/agent.c
index ec1f29a..6eb9ef8 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -947,19 +947,16 @@ void __connman_agent_cleanup(void)
if (agent_watch > 0)
g_dbus_remove_watch(connection, agent_watch);
- if (agent_path == NULL)
- return;
-
- message = dbus_message_new_method_call(agent_sender, agent_path,
- CONNMAN_AGENT_INTERFACE, "Release");
- if (message == NULL)
- return;
-
- dbus_message_set_no_reply(message, TRUE);
-
- g_dbus_send_message(connection, message);
+ if (agent_path != NULL) {
+ message = dbus_message_new_method_call(agent_sender, agent_path,
+ CONNMAN_AGENT_INTERFACE, "Release");
+ if (message != NULL) {
+ dbus_message_set_no_reply(message, TRUE);
+ g_dbus_send_message(connection, message);
+ }
- agent_free();
+ agent_free();
+ }
dbus_connection_unref(connection);
}
--
1.7.10.4
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman