summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-04-13 10:19:06 +0200
committerThomas Haller <thaller@redhat.com>2018-04-13 10:34:03 +0200
commit26a8d2a1515b8cafd7f6d59d9b2c1642b23cd172 (patch)
tree434cfb62148df2ca1d034af519310302927f7900
parente9de083c649b79551d4648a1b95f501955b5277e (diff)
downloadNetworkManager-26a8d2a1515b8cafd7f6d59d9b2c1642b23cd172.tar.gz
settings: fix leaking connection in NMSettings' connection_removed()
Also, take a reference of the NMSettingsConnection while it is being tracked by NMSettings' list. Fixes: 1f3b47deea84888813ed482f5b3e75292b0f2726
-rw-r--r--src/settings/nm-settings.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index 20346929d6..6c66b22f1b 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -889,7 +889,7 @@ connection_removed (NMSettingsConnection *connection, gpointer user_data)
if (priv->connections_loaded)
g_signal_emit (self, signals[CONNECTION_REMOVED], 0, connection);
- g_object_ref (connection);
+ g_object_unref (connection);
check_startup_complete (self);
}
@@ -1003,6 +1003,7 @@ claim_connection (NMSettings *self, NMSettingsConnection *connection)
_clear_connections_cached_list (priv);
+ g_object_ref (connection);
priv->connections_len++;
c_list_link_tail (&priv->connections_lst_head, &connection->_connections_lst);