Commit e63aaaa6 authored by Arvind Yadav's avatar Arvind Yadav Committed by Pablo Neira Ayuso

netfilter: nf_tables: Release memory obtained by kasprintf

Free memory region, if nf_tables_set_alloc_name is not successful.

Fixes: 38745490 ("netfilter: nf_tables: Allow set names of up to 255 chars")
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent e6b72ee8
...@@ -2741,8 +2741,10 @@ static int nf_tables_set_alloc_name(struct nft_ctx *ctx, struct nft_set *set, ...@@ -2741,8 +2741,10 @@ static int nf_tables_set_alloc_name(struct nft_ctx *ctx, struct nft_set *set,
list_for_each_entry(i, &ctx->table->sets, list) { list_for_each_entry(i, &ctx->table->sets, list) {
if (!nft_is_active_next(ctx->net, i)) if (!nft_is_active_next(ctx->net, i))
continue; continue;
if (!strcmp(set->name, i->name)) if (!strcmp(set->name, i->name)) {
kfree(set->name);
return -ENFILE; return -ENFILE;
}
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment