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.
__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();