← Commit list

d4b62bff64

Daniel Stenberg
Daniel Stenberg
2025-12-25
SUCCESS Duration: 256s

Subject

curl_threads: don't do another malloc if the first fails

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/curl_threads.c+4 -1
@@ -54,8 +54,11 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
(CURL_STDCALL *func) (void *), void *arg)
{
curl_thread_t t = curlx_malloc(sizeof(pthread_t));
- struct Curl_actual_call *ac = curlx_malloc(sizeof(struct Curl_actual_call));
+ struct Curl_actual_call *ac = NULL;
int rc;
+
+ if(t)
+ ac = curlx_malloc(sizeof(struct Curl_actual_call));
if(!(ac && t))
goto err;