mirror of
https://github.com/torvalds/linux.git
synced 2024-12-20 10:01:56 +00:00
netfilter: nf_tables: free set name in error path
set->name must be free'd here in case ops->init fails.
Fixes: 387454901b
("netfilter: nf_tables: Allow set names of up to 255 chars")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
569ccae68b
commit
2f6adf4815
@ -3212,18 +3212,20 @@ static int nf_tables_newset(struct net *net, struct sock *nlsk,
|
||||
|
||||
err = ops->init(set, &desc, nla);
|
||||
if (err < 0)
|
||||
goto err2;
|
||||
goto err3;
|
||||
|
||||
err = nft_trans_set_add(&ctx, NFT_MSG_NEWSET, set);
|
||||
if (err < 0)
|
||||
goto err3;
|
||||
goto err4;
|
||||
|
||||
list_add_tail_rcu(&set->list, &table->sets);
|
||||
table->use++;
|
||||
return 0;
|
||||
|
||||
err3:
|
||||
err4:
|
||||
ops->destroy(set);
|
||||
err3:
|
||||
kfree(set->name);
|
||||
err2:
|
||||
kvfree(set);
|
||||
err1:
|
||||
|
Loading…
Reference in New Issue
Block a user