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

Closes #20095
This commit is contained in:
Daniel Stenberg 2025-12-25 18:06:37 +01:00
parent 685173e881
commit d4b62bff64
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -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;