]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: resolvers: fix dangling list pointer in resolvers_new() error paths
authorWilly Tarreau <w@1wt.eu>
Thu, 14 May 2026 22:59:58 +0000 (22:59 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 May 2026 15:39:25 +0000 (17:39 +0200)
commit493dc352ad70988ebbcd01c4f406443973071940
tree772f5db6eab10d85089857bb7602844968c82cf8
parent8aa99dfc745ffd4323f311e70e990753a9f9f364
BUG/MINOR: resolvers: fix dangling list pointer in resolvers_new() error paths

The resolver 'r' is appended to the global sec_resolvers list, but upon failure
later, pointers are released but the element remains in the list, corrupting it,
and possibly causing a crash during deinit() when releasing remaining ones.
Adding a LIST_DEL_INIT() on the error unrolling path is sufficient.

Note that the issue will only happen on failure to allocate memory via
strdup() so the risk is low. The bug was introduced in 2.6 by commit
e7f5776800 ("MINOR: resolvers: resolvers_new() create a resolvers with
default values"), so the fix may be backported to several releases, but
does not necessarily have to go that far.
src/resolvers.c