mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
netfilter: nf_nat: Fix memleak in nf_nat_init
commit869f4fdaf4
upstream. When register_pernet_subsys() fails, nf_nat_bysource should be freed just like when nf_ct_extend_register() fails. Fixes:1cd472bf03
("netfilter: nf_nat: add nat hook register functions to nf_nat") Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Acked-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
49fc6d92b4
commit
9351148633
1 changed files with 1 additions and 0 deletions
|
@ -1174,6 +1174,7 @@ static int __init nf_nat_init(void)
|
||||||
ret = register_pernet_subsys(&nat_net_ops);
|
ret = register_pernet_subsys(&nat_net_ops);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
nf_ct_extend_unregister(&nat_extend);
|
nf_ct_extend_unregister(&nat_extend);
|
||||||
|
kvfree(nf_nat_bysource);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue