summaryrefslogtreecommitdiff
path: root/plugins/openconnect.c
diff options
context:
space:
mode:
authorMohamed Abbas <mohamed.abbas@intel.com>2010-09-22 04:35:35 -0700
committerSamuel Ortiz <sameo@linux.intel.com>2010-09-22 17:23:30 +0200
commit0afd84eff3503b6341c67e9f5b5f9e38dd73d3ce (patch)
treec4bb7302896872ae369ef8e9839cc2627f84588d /plugins/openconnect.c
parentdd16bc7188bb62028efdc82f56f04f9760c086b4 (diff)
downloadconnman-0afd84eff3503b6341c67e9f5b5f9e38dd73d3ce.tar.gz
connman-0afd84eff3503b6341c67e9f5b5f9e38dd73d3ce.tar.bz2
connman-0afd84eff3503b6341c67e9f5b5f9e38dd73d3ce.zip
Fix bug to remove vpn services when turning offline mode on
This patch will remove all vpn services on offline mode. It also make sure it exits after releasing all resources. Fixes BMC #6591
Diffstat (limited to 'plugins/openconnect.c')
-rw-r--r--plugins/openconnect.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/openconnect.c b/plugins/openconnect.c
index 11377c3e..2ddb9046 100644
--- a/plugins/openconnect.c
+++ b/plugins/openconnect.c
@@ -121,8 +121,6 @@ static void openconnect_died(struct connman_task *task, void *user_data)
kill_tun(data->if_name);
connman_provider_set_data(provider, NULL);
connman_rtnl_remove_watch(data->watch);
- connman_provider_unref(data->provider);
- g_free(data);
oc_exit:
if (state != OC_STATE_READY && state != OC_STATE_DISCONNECT)
@@ -133,6 +131,9 @@ static void openconnect_died(struct connman_task *task, void *user_data)
CONNMAN_PROVIDER_STATE_IDLE);
connman_provider_set_index(provider, -1);
+ connman_provider_unref(data->provider);
+ g_free(data);
+
connman_task_destroy(task);
}