]> git.ipfire.org Git - thirdparty/curl.git/commit
hostip.c: fix leak of addrinfo
authorStefan Eissing <stefan@eissing.org>
Thu, 29 Jan 2026 10:59:05 +0000 (11:59 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 2 Feb 2026 22:29:45 +0000 (23:29 +0100)
commitffdbc04c7b039f5306454d207c2909ffaaff1794
treee80469d7ab2a2aaea2750f02098c24a78ea30fa3
parenta84b041281463315d3f8723febc97be1147964f4
hostip.c: fix leak of addrinfo

When creating a dns entry, the addrinfo is passed into the entry on
success and needed deallocation by the caller on failure.

Change the signature to have Curl_dnscache_mk_entry() *always* take
ownership of the addrinfo, even on failure. Change parameter to address
of pointer so that call always clears it.

This makes the handling of failures to Curl_dnscache_mk_entry() simpler.

Fixes #20465
Closes #20468
lib/asyn-ares.c
lib/asyn-thrdd.c
lib/doh.c
lib/hostip.c
lib/hostip.h