mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-10 14:58:30 +02:00
settings: fix memory leak in Update2() options parsing
The "{&sv}" format in g_variant_iter_next() borrows the key but creates
a new reference for the value.
Fixes: 82d16789a5 ('settings-connection: add a "plugin" argument to Update2()')
This commit is contained in:
parent
fd037132e7
commit
08d9476708
1 changed files with 2 additions and 0 deletions
|
|
@ -1866,6 +1866,8 @@ impl_settings_connection_update2(NMDBusObject *obj,
|
|||
|
||||
g_variant_iter_init(&iter, args);
|
||||
while (g_variant_iter_next(&iter, "{&sv}", &args_name, &args_value)) {
|
||||
gs_unref_variant GVariant *args_value_unref = args_value;
|
||||
|
||||
if (plugin_name == NULL && nm_streq(args_name, "plugin")
|
||||
&& g_variant_is_of_type(args_value, G_VARIANT_TYPE_STRING)) {
|
||||
plugin_name = g_variant_dup_string(args_value, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue