diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-02-10 13:32:28 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-02-17 19:39:07 +0100 |
commit | 139b9974fa34ee01b9ff57b45e64faaf645db5e8 (patch) | |
tree | 8a7c0d51796412b61696242f33e55b5c268c02d7 | |
parent | 8d9685ef98937a76b57c37c8d3f6946edfe1c420 (diff) | |
download | NetworkManager-139b9974fa34ee01b9ff57b45e64faaf645db5e8.tar.gz |
ovs: fix leak of json objects
Fixes: 830a5a14cb29ca00b73a9623c1ea7c5cd92f4d00
-rw-r--r-- | src/devices/ovs/nm-ovsdb.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/devices/ovs/nm-ovsdb.c b/src/devices/ovs/nm-ovsdb.c index 8622f86bf7..d3f573ede1 100644 --- a/src/devices/ovs/nm-ovsdb.c +++ b/src/devices/ovs/nm-ovsdb.c @@ -348,14 +348,14 @@ _insert_interface (json_t *params, NMConnection *interface) if (s_ovs_iface) type = nm_setting_ovs_interface_get_interface_type (s_ovs_iface); - json_array_append (options, json_string ("map")); + json_array_append_new (options, json_string ("map")); s_ovs_patch = nm_connection_get_setting_ovs_patch (interface); if (s_ovs_patch) { - json_array_append (options, json_pack ("[[s, s]]", + json_array_append_new (options, json_pack ("[[s, s]]", "peer", nm_setting_ovs_patch_get_peer (s_ovs_patch))); } else { - json_array_append (options, json_array ()); + json_array_append_new (options, json_array ()); } json_array_append_new (params, @@ -606,7 +606,8 @@ _delete_interface (NMOvsdb *self, json_t *params, const char *ifname) OpenvswitchBridge *ovs_bridge; OpenvswitchPort *ovs_port; OpenvswitchInterface *ovs_interface; - json_t *bridges, *new_bridges; + nm_auto_decref_json json_t *bridges = NULL; + nm_auto_decref_json json_t *new_bridges = NULL; gboolean bridges_changed; gboolean ports_changed; gboolean interfaces_changed; |