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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2741,9 +2741,11 @@ 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;
}