Hi.

Attached an small patch which Opus thinks that's fix an Memory leak, this was found by build and testing for cloudauth filter.

Best Regards
Aleks
From 274eb9255bedb5c1b44035917e8be39c0467ed4e Mon Sep 17 00:00:00 2001
From: Aleksandar Lazic <[email protected]>
Date: Sat, 17 Oct 2026 21:40:58 +0200
Subject: [PATCH] BUG/MINOR: filters: free the error message of the
 filter-config parsers

flt_precheck_instance() passes a message to the ->parse() callback of
the filter classes, which may allocate it with memprintf() to report an
error. The message was reported with ha_alert() but never released, so
it leaked each time a "filter-config" instance failed to be parsed, for
instance with "filter-config trace id t1 bogus-option", as reported by
ASAN.

This only happens on configuration errors, which are fatal at boot, but
the instances of the proxies created at runtime are parsed the same way.
Let's release the message once reported, and also on success in case a
parser fills it without failing.

This was brought by commit b3075cf7f ("MEDIUM: filters: Parse and
finalize filter-config instances") in 3.5-dev9, so no backport is
needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/filters.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/filters.c b/src/filters.c
index a76a146ff..ab1184b3d 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -2869,8 +2869,10 @@ static int flt_precheck_instance(struct proxy *proxy, struct filter_instance *in
 			 proxy_type_str(proxy), proxy->id, inst->class->name,
 			 inst->conf.file, inst->conf.line,
 			 err && *err ? err : "unknown error");
+		free(err);
 		return ERR_ALERT | ERR_FATAL;
 	}
+	free(err);
 	if (!inst->fconf->ops) {
 		ha_alert("config: %s '%s' : filter class '%s' defined no callbacks for the instance from %s:%d.\n",
 			 proxy_type_str(proxy), proxy->id, inst->class->name,
-- 
2.56.0

Reply via email to