Skip to contentSkip to conversation

trace: Fix for memleak in trace_alloc_list() error path

PATCH In review Phil Sutter 2 participants 2 messages Aug 26, 2025 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 trace: Fix for memleak in trace_alloc_list() error path

The allocated 'list_expr' may leak.

Fixes cfd768615235b ("src: add conntrack information to trace monitor mode")
---
 src/trace.c | 1 +
 1 file changed, 1 insertion(+)
src/trace.c +1 -0
index b270951025b88..47f4c2159421e 100644
@@ -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;
 	}
 
Signature · 1 line
2.51.0