]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: filters: free the error message of the filter-config parsers
authorAleksandar Lazic <al-haproxy@none.at>
Sat, 17 Oct 2026 19:40:58 +0000 (21:40 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 19 Oct 2026 19:53:20 +0000 (21:53 +0200)
commite752ebe04b34a388399f414a89b7b760813f140a
treeccc2abf936f45dd25f74ae55447e2c649e0f27bc
parent4f0076be836f2a80d5aad09a4fe17f745d7c50b8
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 <noreply@anthropic.com>
src/filters.c