pf: fix memory leak
The nvlist is allocated in pf_keth_rule_to_nveth_rule(). There's no need to allocate one in the calling function. Especially not as we overwrite the pointer to the new nvlist with the one allocated by pf_keth_rule_to_nveth_rule(), leaking memory. Reported by: Coverity CID: 1476128 Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
parent
e85eaa9308
commit
0bd468ea3f
@ -2720,8 +2720,6 @@ DIOCGETETHRULES_error:
|
||||
free(nvlpacked, M_TEMP);
|
||||
nvlpacked = NULL;
|
||||
|
||||
nvl = nvlist_create(0);
|
||||
|
||||
rule = TAILQ_FIRST(rs->active.rules);
|
||||
while ((rule != NULL) && (rule->nr != nr))
|
||||
rule = TAILQ_NEXT(rule, entries);
|
||||
|
Loading…
x
Reference in New Issue
Block a user