]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
trace: Fix for memleak in trace_alloc_list() error path
authorPhil Sutter <phil@nwl.cc>
Tue, 26 Aug 2025 10:57:37 +0000 (12:57 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 26 Aug 2025 13:27:18 +0000 (15:27 +0200)
The allocated 'list_expr' may leak.

Fixes: cfd768615235b ("src: add conntrack information to trace monitor mode")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
src/trace.c

index b270951025b8854fbf40e27f25f805e5c85a87a4..47f4c2159421e49708a504160f58bc3fc446521f 100644 (file)
@@ -258,6 +258,7 @@ static struct expr *trace_alloc_list(const struct datatype *dtype,
        v = mpz_get_uint32(value);
        if (v == 0) {
                mpz_clear(value);
+               expr_free(list_expr);
                return NULL;
        }