mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 03:08:08 +02:00
libnm/vpn: clear internal "keyfile" from NMVpnPluginInfo
The GKeyFile is no longer needed after constuction. All strings are copied over to the "keys" hash.
This commit is contained in:
parent
6878999ca3
commit
4003edbbf9
1 changed files with 6 additions and 4 deletions
|
|
@ -877,15 +877,16 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
|
||||||
for (j = 0; keys && keys[j]; j++) {
|
for (j = 0; keys && keys[j]; j++) {
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
/* Lookup the value via get_string(). We want that behavior.
|
/* Lookup the value via get_string(). We want that behavior for all our
|
||||||
* You could still lookup the original values via g_key_file_get_value()
|
* values. */
|
||||||
* based on priv->keyfile. */
|
|
||||||
s = g_key_file_get_string (priv->keyfile, groups[i], keys[j], NULL);
|
s = g_key_file_get_string (priv->keyfile, groups[i], keys[j], NULL);
|
||||||
if (s)
|
if (s)
|
||||||
g_hash_table_insert (priv->keys, _nm_utils_strstrdictkey_create (groups[i], keys[j]), s);
|
g_hash_table_insert (priv->keys, _nm_utils_strstrdictkey_create (groups[i], keys[j]), s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_clear_pointer (&priv->keyfile, g_key_file_unref);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -948,9 +949,10 @@ finalize (GObject *object)
|
||||||
g_free (priv->service);
|
g_free (priv->service);
|
||||||
g_strfreev (priv->aliases);
|
g_strfreev (priv->aliases);
|
||||||
g_free (priv->filename);
|
g_free (priv->filename);
|
||||||
g_key_file_unref (priv->keyfile);
|
|
||||||
g_hash_table_unref (priv->keys);
|
g_hash_table_unref (priv->keys);
|
||||||
|
|
||||||
|
g_clear_pointer (&priv->keyfile, g_key_file_unref);
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_vpn_plugin_info_parent_class)->finalize (object);
|
G_OBJECT_CLASS (nm_vpn_plugin_info_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue