]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft: Fix leak when deleting rules
authorPhil Sutter <phil@nwl.cc>
Tue, 5 May 2020 11:41:43 +0000 (13:41 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 11 May 2020 12:28:29 +0000 (14:28 +0200)
For NFT_COMPAT_RULE_DELETE jobs, batch_obj_del() has to do the rule
freeing, they are no longer in cache.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/nft.c

index c0b5e2fc524a7a1a6aeb92a0706493accaf4196d..01268f7859e9bed30cbdfd447fb700ac4292d650 100644 (file)
@@ -2680,8 +2680,8 @@ static void batch_obj_del(struct nft_handle *h, struct obj_update *o)
        case NFT_COMPAT_RULE_APPEND:
        case NFT_COMPAT_RULE_INSERT:
        case NFT_COMPAT_RULE_REPLACE:
-       case NFT_COMPAT_RULE_DELETE:
                break;
+       case NFT_COMPAT_RULE_DELETE:
        case NFT_COMPAT_RULE_FLUSH:
                nftnl_rule_free(o->rule);
                break;