Loading
netfilter: nf_tables: fix memory leak in nf_tables_newrule()
In nf_tables_newrule(), if nft_use_inc() fails, the function jumps to the err_release_rule label without freeing the allocated flow, leading to a memory leak. Fix this by adding a new label err_destroy_flow and jumping to it when nft_use_inc() fails. This ensures that the flow is properly released in this error case. Fixes: 1689f259 ("netfilter: nf_tables: report use refcount overflow") Signed-off-by:Zilin Guan <zilin@seu.edu.cn> Signed-off-by:
Florian Westphal <fw@strlen.de>