mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 19:18:00 +02:00
libnm: use cleanup attribute in NMVpnPluginOld's _connect_generic()
This commit is contained in:
parent
e56f126071
commit
bbe39ed095
1 changed files with 7 additions and 8 deletions
|
|
@ -420,12 +420,12 @@ _connect_generic(NMVpnPluginOld * plugin,
|
||||||
GVariant * properties,
|
GVariant * properties,
|
||||||
GVariant * details)
|
GVariant * details)
|
||||||
{
|
{
|
||||||
NMVpnPluginOldPrivate *priv = NM_VPN_PLUGIN_OLD_GET_PRIVATE(plugin);
|
NMVpnPluginOldPrivate *priv = NM_VPN_PLUGIN_OLD_GET_PRIVATE(plugin);
|
||||||
NMVpnPluginOldClass * vpn_class = NM_VPN_PLUGIN_OLD_GET_CLASS(plugin);
|
NMVpnPluginOldClass * vpn_class = NM_VPN_PLUGIN_OLD_GET_CLASS(plugin);
|
||||||
gs_unref_object NMConnection *connection = NULL;
|
gs_unref_object NMConnection *connection = NULL;
|
||||||
gboolean success = FALSE;
|
gboolean success = FALSE;
|
||||||
GError * error = NULL;
|
gs_free_error GError *error = NULL;
|
||||||
guint fail_stop_timeout = 0;
|
guint fail_stop_timeout = 0;
|
||||||
|
|
||||||
if (priv->state != NM_VPN_SERVICE_STATE_STOPPED && priv->state != NM_VPN_SERVICE_STATE_INIT) {
|
if (priv->state != NM_VPN_SERVICE_STATE_STOPPED && priv->state != NM_VPN_SERVICE_STATE_INIT) {
|
||||||
g_dbus_method_invocation_return_error(context,
|
g_dbus_method_invocation_return_error(context,
|
||||||
|
|
@ -444,7 +444,6 @@ _connect_generic(NMVpnPluginOld * plugin,
|
||||||
NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
|
NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
|
||||||
"Invalid connection: %s",
|
"Invalid connection: %s",
|
||||||
error->message);
|
error->message);
|
||||||
g_clear_error(&error);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -479,7 +478,7 @@ _connect_generic(NMVpnPluginOld * plugin,
|
||||||
/* Add a timer to make sure we do not wait indefinitely for the successful connect. */
|
/* Add a timer to make sure we do not wait indefinitely for the successful connect. */
|
||||||
connect_timer_start(plugin);
|
connect_timer_start(plugin);
|
||||||
} else {
|
} else {
|
||||||
g_dbus_method_invocation_take_error(context, error);
|
g_dbus_method_invocation_take_error(context, g_steal_pointer(&error));
|
||||||
|
|
||||||
/* Stop the plugin from an idle handler so that the Connect
|
/* Stop the plugin from an idle handler so that the Connect
|
||||||
* method return gets sent before the STOP StateChanged signal.
|
* method return gets sent before the STOP StateChanged signal.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue