Skip to content

Commit

Permalink
parser: Plug a couple of memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloegea committed Feb 28, 2023
1 parent 74b9f68 commit 3f69b82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3f69b82

Please sign in to comment.