mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 15:41:39 +00:00
netfilter: nf_tables: Release memory obtained by kasprintf
Free memory region, if nf_tables_set_alloc_name is not successful.
Fixes: 387454901b
("netfilter: nf_tables: Allow set names of up to 255 chars")
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
e6b72ee88a
commit
e63aaaa6be
@ -2741,8 +2741,10 @@ cont:
|
||||
list_for_each_entry(i, &ctx->table->sets, list) {
|
||||
if (!nft_is_active_next(ctx->net, i))
|
||||
continue;
|
||||
if (!strcmp(set->name, i->name))
|
||||
if (!strcmp(set->name, i->name)) {
|
||||
kfree(set->name);
|
||||
return -ENFILE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user