]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: dns: fix dangling dgram pointer on dns_dgram_init() failure path
authorWilly Tarreau <w@1wt.eu>
Thu, 14 May 2026 20:56:52 +0000 (20:56 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 May 2026 15:39:25 +0000 (17:39 +0200)
commit569f1e2f3719c2e45b3496332fe4f8467574b16f
tree0ef2477d35f98f537910a11d487d6a9410cfda26
parent493dc352ad70988ebbcd01c4f406443973071940
BUG/MINOR: dns: fix dangling dgram pointer on dns_dgram_init() failure path

In dns_dgram_init(), the newly created dgram is assigned to the name server
before the ring is attached. In case of errors, e.g. due to too many watchers,
the dgram is released but not removed from ns->dgram. Let's only assign the
pointer on success to avoid this, as it's not needed before. The problem
was introduced in 2.4 with commit c943799c86 ("MEDIUM: resolvers/dns: split
dns.c into dns.c and resolvers.c"), and was possibly there before. The fix
may be backported to all stable versions.
src/dns.c