mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Do not leak memory while flushing rules.
Noticed by: yar Approved by: glebius (mentor) MFC after: 1 week
This commit is contained in:
parent
f8b20fb6d6
commit
9b1858ca78
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160920
@ -3957,9 +3957,10 @@ ipfw_ctl(struct sockopt *sopt)
|
||||
IPFW_WLOCK(&layer3_chain);
|
||||
layer3_chain.reap = NULL;
|
||||
free_chain(&layer3_chain, 0 /* keep default rule */);
|
||||
rule = layer3_chain.reap, layer3_chain.reap = NULL;
|
||||
rule = layer3_chain.reap;
|
||||
layer3_chain.reap = NULL;
|
||||
IPFW_WUNLOCK(&layer3_chain);
|
||||
if (layer3_chain.reap != NULL)
|
||||
if (rule != NULL)
|
||||
reap_rules(rule);
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user