]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
asyn-thread: drop `free()` on non-heap address
authorViktor Szakats <commit@vsz.me>
Sat, 15 Mar 2025 01:39:05 +0000 (02:39 +0100)
committerViktor Szakats <commit@vsz.me>
Sat, 15 Mar 2025 22:01:12 +0000 (23:01 +0100)
seen with mingw-w64 gcc 14.2.0 while playing with other modifications:
```
lib/asyn-thread.c: In function 'init_resolve_thread':
lib/asyn-thread.c:447:5: warning: 'free' called on pointer 'data' with nonzero offset 3264 [-Wfree-nonheap-object]
  447 |     free(td);
      |     ^~~~~~~~
```

Where `td` is:
```c
  struct thread_data *td = &data->state.async.thdata;
```

Follow-up to d9fc64d3ab289a84548e952183d7eba79ccc846e #16241
Closes #16734

lib/asyn-thread.c

index c057ee8eb8ceaafe90b13bf3bcbbbd405e7b77ec..c3820e76176a3948f3b9cd367783216a0d3fd814 100644 (file)
@@ -444,7 +444,6 @@ static bool init_resolve_thread(struct Curl_easy *data,
   td->start = Curl_now();
 
   if(!init_thread_sync_data(td, hostname, port, hints)) {
-    free(td);
     goto errno_exit;
   }