]> git.ipfire.org Git - thirdparty/iptables.git/commit
nft: cache: Avoid double free of unrecognized base-chains
authorPhil Sutter <phil@nwl.cc>
Tue, 21 Sep 2021 09:39:45 +0000 (11:39 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 27 Sep 2021 11:29:28 +0000 (13:29 +0200)
commit4318961230bce82958df82b57f1796143bf2f421
treefcc023e0a78057c7d8d1fd2df2a1a5cb91a6f209
parent040a15f27075ccded8d819af6cf0484c532515ef
nft: cache: Avoid double free of unrecognized base-chains

On error, nft_cache_add_chain() frees the allocated nft_chain object
along with the nftnl_chain it points at. Fix nftnl_chain_list_cb() to
not free the nftnl_chain again in that case.

Fixes: 176c92c26bfc9 ("nft: Introduce a dedicated base chain array")
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/nft-cache.c
iptables/tests/shell/testcases/chain/0004extra-base_0 [new file with mode: 0755]