]> git.ipfire.org Git - thirdparty/curl.git/commit
conn: fix hostname move on connection reuse
authorStefan Eissing <stefan@eissing.org>
Fri, 10 Oct 2025 07:48:52 +0000 (09:48 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 10 Oct 2025 21:45:58 +0000 (23:45 +0200)
commitbf41be6292cf712315815c722aab2653a0ec827f
treea14ba040cd41efd7d9c8f87ebe94c6301801a82d
parent9d7b532404181568de1611084bd9f446cd4a4d26
conn: fix hostname move on connection reuse

When reusing a connection, the `host` and `conn_to_host` hostname
structs are moved from the template connection onto the existing one.

There was a NULLing of a tempplate member missing in `conn_to_host`
which could then lead to a double free.

Make this struct move into a static function, doing the correct
thing for both `struct hostname` in a connection.

Reported-by: Joshua Rogers
Closes #18995
lib/url.c