diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-11-26 12:16:32 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-11-26 16:25:25 +0200 |
commit | ac7687f56ce4f6a33f95c0c0945424d291ce756d (patch) | |
tree | 0ab3bb084f5313de4e28df8546e1527bca8dee38 /plugins/vpn.c | |
parent | 6210026c3b0a468e540d0d83bec6a17a4328b7ea (diff) | |
download | connman-ac7687f56ce4f6a33f95c0c0945424d291ce756d.tar.gz connman-ac7687f56ce4f6a33f95c0c0945424d291ce756d.tar.bz2 connman-ac7687f56ce4f6a33f95c0c0945424d291ce756d.zip |
vpn: Cleanup properly if vpn connect fails
Make sure that user callback data is cleared correctly
if vpn connect attempt fails.
Diffstat (limited to 'plugins/vpn.c')
-rw-r--r-- | plugins/vpn.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/vpn.c b/plugins/vpn.c index c41722cf..ff4d7251 100644 --- a/plugins/vpn.c +++ b/plugins/vpn.c @@ -453,7 +453,8 @@ static void connect_reply(DBusPendingCall *call, void *user_data) { DBusMessage *reply; DBusError error; - struct config_create_data *cb_data = user_data; + struct connection_data *data = user_data; + struct config_create_data *cb_data = data->cb_data; if (dbus_pending_call_get_completed(call) == FALSE) return; @@ -475,6 +476,7 @@ static void connect_reply(DBusPendingCall *call, void *user_data) cb_data->callback(cb_data->message, ECONNREFUSED, NULL); free_config_cb_data(cb_data); + data->cb_data = NULL; } goto done; } @@ -525,7 +527,7 @@ static int connect_provider(struct connection_data *data, void *user_data) cb_data->path = g_strdup(data->path); } - dbus_pending_call_set_notify(call, connect_reply, cb_data, NULL); + dbus_pending_call_set_notify(call, connect_reply, data, NULL); dbus_message_unref(message); |