Skip to content

Commit

Permalink
netfilter: nf_tables: Avoid duplicate call to nft_data_uninit() for s…
Browse files Browse the repository at this point in the history
…ame key

nft_del_setelem() currently calls nft_data_uninit() twice on the same
key. Once to release the key which is guaranteed to be NFT_DATA_VALUE
and a second time in the error path to which it falls through.

The second call has been harmless so far though because the type
passed is always NFT_DATA_VALUE which is currently a no-op.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Thomas Graf authored and Pablo Neira Ayuso committed Aug 1, 2014
1 parent 8452e6f commit 0dc1362
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -3218,6 +3218,7 @@ static int nft_del_setelem(struct nft_ctx *ctx, struct nft_set *set,
if (set->flags & NFT_SET_MAP)
nft_data_uninit(&elem.data, set->dtype);

return 0;
err2:
nft_data_uninit(&elem.key, desc.type);
err1:
Expand Down

0 comments on commit 0dc1362

Please sign in to comment.