]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
asyn-thrdd: free the previous name before strdup'ing the new
authorDaniel Stenberg <daniel@haxx.se>
Thu, 12 Jun 2025 09:46:51 +0000 (11:46 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 12 Jun 2025 10:53:57 +0000 (12:53 +0200)
Fixes #17602
Reported-by: hiimmat on github
Closes #17604

lib/asyn-thrdd.c

index 593ef3717565d2752be45990d2347e755645df74..454e31b8b816939d1a765e3409d1a9e66f1ee6a6 100644 (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;