mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 02:20:22 +01:00
all: fix a couple more gvariant iteration leaks
This commit is contained in:
parent
634888aff8
commit
1c5d8d0aec
4 changed files with 7 additions and 4 deletions
|
|
@ -313,6 +313,7 @@ construct_device_dhcp6_items (GSList *items, GVariant *dhcp6_config)
|
|||
tmp = g_variant_get_string (val, NULL);
|
||||
items = g_slist_prepend (items, g_strdup_printf ("DHCP6_%s=%s", ucased, tmp));
|
||||
g_free (ucased);
|
||||
g_variant_unref (val);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2084,8 +2084,7 @@ nm_utils_ip_routes_from_variant (GVariant *value,
|
|||
if ( !g_variant_lookup (route_var, "dest", "&s", &dest)
|
||||
|| !g_variant_lookup (route_var, "prefix", "u", &prefix)) {
|
||||
g_warning ("Ignoring invalid address");
|
||||
g_variant_unref (route_var);
|
||||
continue;
|
||||
goto next;
|
||||
}
|
||||
if (!g_variant_lookup (route_var, "next-hop", "&s", &next_hop))
|
||||
next_hop = NULL;
|
||||
|
|
@ -2098,8 +2097,7 @@ nm_utils_ip_routes_from_variant (GVariant *value,
|
|||
if (!route) {
|
||||
g_warning ("Ignoring invalid route: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
g_variant_unref (route_var);
|
||||
continue;
|
||||
goto next;
|
||||
}
|
||||
|
||||
g_variant_iter_init (&attrs_iter, route_var);
|
||||
|
|
@ -2113,6 +2111,8 @@ nm_utils_ip_routes_from_variant (GVariant *value,
|
|||
}
|
||||
|
||||
g_ptr_array_add (routes, route);
|
||||
next:
|
||||
g_variant_unref (route_var);
|
||||
}
|
||||
|
||||
return routes;
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@ get_managed_objects_cb (GDBusProxy *proxy,
|
|||
G_VARIANT_TYPE_DICTIONARY)) {
|
||||
device_added (proxy, path, self);
|
||||
}
|
||||
g_variant_unref (ifaces);
|
||||
}
|
||||
|
||||
g_variant_unref (variant);
|
||||
|
|
|
|||
|
|
@ -930,6 +930,7 @@ set_secrets_not_required (NMConnection *connection, GVariant *dict)
|
|||
g_variant_unref (val);
|
||||
}
|
||||
}
|
||||
g_variant_unref (setting_dict);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue