projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6351c3
)
netfilter: nf_nat: Fix memleak in nf_nat_init
author
Dinghao Liu
<dinghao.liu@zju.edu.cn>
Sat, 9 Jan 2021 12:01:21 +0000
(20:01 +0800)
committer
Pablo Neira Ayuso
<pablo@netfilter.org>
Sun, 10 Jan 2021 23:34:11 +0000
(
00:34
+0100)
When register_pernet_subsys() fails, nf_nat_bysource
should be freed just like when nf_ct_extend_register()
fails.
Fixes:
1cd472bf036ca
("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>
net/netfilter/nf_nat_core.c
patch
|
blob
|
blame
|
history
diff --git
a/net/netfilter/nf_nat_core.c
b/net/netfilter/nf_nat_core.c
index ea923f8cf9c4258bf0288169a6ecac73f039c25c..b7c3c902290f1486a981c841317334320e01b82c 100644
(file)
--- a/
net/netfilter/nf_nat_core.c
+++ b/
net/netfilter/nf_nat_core.c
@@
-1174,6
+1174,7
@@
static int __init nf_nat_init(void)
ret = register_pernet_subsys(&nat_net_ops);
if (ret < 0) {
nf_ct_extend_unregister(&nat_extend);
+ kvfree(nf_nat_bysource);
return ret;
}