Skip to content
Commit 7eaf837a authored by Quan Tian's avatar Quan Tian Committed by Pablo Neira Ayuso
Browse files

netfilter: nf_tables: Fix a memory leak in nf_tables_updchain



If nft_netdev_register_hooks() fails, the memory associated with
nft_stats is not freed, causing a memory leak.

This patch fixes it by moving nft_stats_alloc() down after
nft_netdev_register_hooks() succeeds.

Fixes: b9703ed4 ("netfilter: nf_tables: support for adding new devices to an existing netdev chain")
Signed-off-by: default avatarQuan Tian <tianquan23@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 4a0e7f2d
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