asyn-thrdd: free the previous name before strdup'ing the new

Fixes #17602
Reported-by: hiimmat on github
Closes #17604
This commit is contained in:
Daniel Stenberg 2025-06-12 11:46:51 +02:00
parent 49a1cfaec2
commit c257753ee9
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -422,6 +422,7 @@ static bool async_thrdd_init(struct Curl_easy *data,
data->state.async.done = FALSE;
data->state.async.port = port;
data->state.async.ip_version = ip_version;
free(data->state.async.hostname);
data->state.async.hostname = strdup(hostname);
if(!data->state.async.hostname)
goto err_exit;