mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 09:21:26 +03:00
network: fix memleak in routing policy
As set_put() may fail if input is duplicated.
This commit is contained in:
parent
744faf5e4e
commit
a6276f0f3f
@ -257,8 +257,8 @@ static int routing_policy_rule_add_internal(Manager *m,
|
||||
rule->tos = tos;
|
||||
rule->fwmark = fwmark;
|
||||
rule->table = table;
|
||||
rule->iif = TAKE_PTR(iif);
|
||||
rule->oif = TAKE_PTR(oif);
|
||||
rule->iif = iif;
|
||||
rule->oif = oif;
|
||||
|
||||
r = set_ensure_allocated(rules, &routing_policy_rule_hash_ops);
|
||||
if (r < 0)
|
||||
@ -272,6 +272,7 @@ static int routing_policy_rule_add_internal(Manager *m,
|
||||
*ret = rule;
|
||||
|
||||
rule = NULL;
|
||||
iif = oif = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user