Commit e791a9d2 authored by Thomas Haller's avatar Thomas Haller

manager: fix leaking settings connection in active_connection_remove()

We must always unref @connection, not only in case of
nm_settings_has_connection().

Fixes: 74ed416d
parent 5f574365
......@@ -279,11 +279,12 @@ active_connection_remove (NMManager *self, NMActiveConnection *active)
nm_exported_object_clear_and_unexport (&active);
if ( connection
&& nm_settings_has_connection (priv->settings, connection)) {
_LOGD (LOGD_DEVICE, "assumed connection disconnected. Deleting generated connection '%s' (%s)",
nm_settings_connection_get_id (connection), nm_settings_connection_get_uuid (connection));
nm_settings_connection_delete (NM_SETTINGS_CONNECTION (connection), NULL, NULL);
if (connection) {
if (nm_settings_has_connection (priv->settings, connection)) {
_LOGD (LOGD_DEVICE, "assumed connection disconnected. Deleting generated connection '%s' (%s)",
nm_settings_connection_get_id (connection), nm_settings_connection_get_uuid (connection));
nm_settings_connection_delete (connection, NULL, NULL);
}
g_object_unref (connection);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment