Fix agent cleanup function
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 26 Feb 2008 05:42:59 +0000 (06:42 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 26 Feb 2008 05:42:59 +0000 (06:42 +0100)
src/agent.c

index 4765868..b7db03c 100644 (file)
@@ -107,8 +107,13 @@ void __connman_agent_cleanup(void)
        if (agent_watch > 0)
                g_dbus_remove_watch(connection, agent_watch);
 
+       if (agent_path == NULL)
+               return;
+
        msg = dbus_message_new_method_call(agent_sender, agent_path,
                                        CONNMAN_AGENT_INTERFACE, "Release");
+       if (msg == NULL)
+               return;
 
        dbus_message_set_no_reply(msg, TRUE);