session: Reorder shutdown sequence
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 9 Apr 2013 16:13:07 +0000 (18:13 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 18 Apr 2013 05:43:43 +0000 (08:43 +0300)
By calling __connman_session_cleanup() before __connman_plugin_cleanup()
we make sure all resources allocated can released in the correct order.
The code assumes after an successful allocation, free will always work
and therefore we double free allocated memory.

src/main.c

index 0f47943..a76ec3b 100644 (file)
@@ -676,11 +676,11 @@ int main(int argc, char *argv[])
        __connman_wpad_cleanup();
        __connman_dhcpv6_cleanup();
        __connman_dhcp_cleanup();
+       __connman_session_cleanup();
        __connman_plugin_cleanup();
        __connman_provider_cleanup();
        __connman_connection_cleanup();
        __connman_timeserver_cleanup();
-       __connman_session_cleanup();
        __connman_detect_cleanup();
        __connman_proxy_cleanup();
        __connman_task_cleanup();