summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2016-03-18 17:41:00 +0100
committerLubomir Rintel <lkundrak@v3.sk>2016-03-18 18:04:55 +0100
commit6c12f04e87b439832bdbac57bc8bd85e369a0bc9 (patch)
tree9a72061d0dd8f476b26f1c1cac81c285e02b96b9
parentd568eb0e6c22f3828705530dd6d6cc34e79ae002 (diff)
downloadNetworkManager-6c12f04e87b439832bdbac57bc8bd85e369a0bc9.tar.gz
vpn-connection: do not leak the connection if there's no timeout
-rw-r--r--src/vpn-manager/nm-vpn-connection.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c
index 0c0a42357b..cbc7c69d34 100644
--- a/src/vpn-manager/nm-vpn-connection.c
+++ b/src/vpn-manager/nm-vpn-connection.c
@@ -1945,7 +1945,7 @@ nm_vpn_service_daemon_exec (NMVpnConnection *self, GError **error)
if (success) {
_LOGI ("Started the VPN service, PID %ld", (long int) pid);
- priv->start_timeout = g_timeout_add_seconds (5, _daemon_exec_timeout, g_object_ref (self));
+ priv->start_timeout = g_timeout_add_seconds (5, _daemon_exec_timeout, self);
} else {
g_set_error (error,
NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
@@ -2401,6 +2401,8 @@ dispose (GObject *object)
NMVpnConnection *self = NM_VPN_CONNECTION (object);
NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
+ nm_clear_g_source (&priv->start_timeout);
+
g_clear_pointer (&priv->connect_hash, g_variant_unref);
nm_clear_g_source (&priv->connect_timeout);