]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: resolvers: fix leaks on do-resolve's fetch availability error
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 29 Sep 2026 08:54:36 +0000 (10:54 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 10 Nov 2026 14:47:52 +0000 (15:47 +0100)
commit88181a0849f1cc22554ec7947e9947ee1f128a46
tree91af971ee2f85fe3f94338af699e9b48a2d5a011
parentfacf6eba92e2ccdb29f47156cac65f6675227834
BUG/MINOR: resolvers: fix leaks on do-resolve's fetch availability error

When the sample fetch used by a do-resolve rule is not available in the
rule's context (e.g. "res.hdr(x)" in an http-request rule),
resolv_parse_do_resolve() releases the sample expression with free()
instead of release_sample_expr(), leaking its arguments and converters,
and returns without releasing the variable name, resolvers id and
options it already allocated, contrary to the other error paths.

This only happens on configuration errors, after which the process
exits, but it's visible with valgrind:

    backend b
        http-request do-resolve(txn.ip,r) res.hdr(x)

reports 349 bytes definitely lost in 4 blocks before this fix, 0 after.

While this patch may be backported to all stable version, it is harmless.
So no reason to backport it.
src/resolvers.c