From 3f69b827049debbd131696e4837c8126b6b7006e Mon Sep 17 00:00:00 2001 From: Danilo Egea Gondolfo Date: Tue, 28 Feb 2023 15:59:55 +0000 Subject: [PATCH] parser: Plug a couple of memory leaks --- src/parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parse.c b/src/parse.c index bcf3dfac0..145a1b179 100644 --- a/src/parse.c +++ b/src/parse.c @@ -2038,7 +2038,7 @@ handle_ip_rules(NetplanParser* npp, yaml_node_t* node, const void* _, GError** e ip_rule->from, ip_rule->to, ip_rule->table); - ip_rule_clear(&npp->current.ip_rule); + ip_rule_clear(&ip_rule); npp->current.ip_rule = NULL; continue; } @@ -2542,8 +2542,10 @@ handle_ovs_bridge_controller_addresses(NetplanParser* npp, yaml_node_t* node, co npp->current.netdef->ovs_settings.controller.addresses = g_array_new(FALSE, FALSE, sizeof(char*)); /* Do not insert the same address twice in the list */ - if (is_string_in_array(npp->current.netdef->ovs_settings.controller.addresses, scalar(entry))) + if (is_string_in_array(npp->current.netdef->ovs_settings.controller.addresses, scalar(entry))) { + g_strfreev(vec); continue; + } /* Format: [p]unix:file */ if (is_unix && vec[1] != NULL && vec[2] == NULL) {