commit | 7eaf837a4eb5f74561e2486972e7f5184b613f6e | [log] [tgz] |
---|---|---|
author | Quan Tian <tianquan23@gmail.com> | Thu Mar 07 01:24:02 2024 +0800 |
committer | Pablo Neira Ayuso <pablo@netfilter.org> | Thu Mar 21 12:12:06 2024 +0100 |
tree | 1ff3a636002bce1d85f2d2ac1baa028926c9447f | |
parent | 4a0e7f2decbf9bd72461226f1f5f7dcc4b08f139 [diff] |
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: b9703ed44ffb ("netfilter: nf_tables: support for adding new devices to an existing netdev chain") Signed-off-by: Quan Tian <tianquan23@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>