From: Daniel Stenberg Date: Thu, 25 Dec 2025 17:06:37 +0000 (+0100) Subject: curl_threads: don't do another malloc if the first fails X-Git-Tag: rc-8_18_0-3~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4b62bff64c489785699ac83eb87a88399bebbc8;p=thirdparty%2Fcurl.git curl_threads: don't do another malloc if the first fails Closes #20095 --- diff --git a/lib/curl_threads.c b/lib/curl_threads.c index 9e4bbc96ec..36a64eb8e3 100644 --- a/lib/curl_threads.c +++ b/lib/curl_threads.c @@ -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;