mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-14 04:00:33 +01:00
libnm-core: fix a leak in _nm_setting_new_from_dbus()
(cherry picked from commit bbbbca2778)
This commit is contained in:
parent
ecd7227d45
commit
a177f443e0
1 changed files with 6 additions and 4 deletions
|
|
@ -796,7 +796,12 @@ _nm_setting_new_from_dbus (GType setting_type,
|
|||
properties = nm_setting_class_get_properties (class, &n_properties);
|
||||
for (i = 0; i < n_properties; i++) {
|
||||
const NMSettingProperty *property = &properties[i];
|
||||
GVariant *value = g_variant_lookup_value (setting_dict, property->name, NULL);
|
||||
GVariant *value;
|
||||
|
||||
if (property->param_spec && !(property->param_spec->flags & G_PARAM_WRITABLE))
|
||||
continue;
|
||||
|
||||
value = g_variant_lookup_value (setting_dict, property->name, NULL);
|
||||
|
||||
if (value && property->set_func) {
|
||||
property->set_func (setting,
|
||||
|
|
@ -810,9 +815,6 @@ _nm_setting_new_from_dbus (GType setting_type,
|
|||
} else if (value && property->param_spec) {
|
||||
GValue object_value = { 0, };
|
||||
|
||||
if (!(property->param_spec->flags & G_PARAM_WRITABLE))
|
||||
continue;
|
||||
|
||||
g_value_init (&object_value, property->param_spec->value_type);
|
||||
set_property_from_dbus (property, value, &object_value);
|
||||
g_object_set_property (G_OBJECT (setting), property->param_spec->name, &object_value);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue