multi: check the return value of strdup()

Closes #19344
This commit is contained in:
x2018 2025-11-04 01:12:42 +08:00 committed by Daniel Stenberg
parent 231f0a2eec
commit 6adefe8ad0
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -1990,11 +1990,16 @@ static CURLMcode state_performing(struct Curl_easy *data,
if(!newurl)
/* typically for HTTP_1_1_REQUIRED error on first flight */
newurl = strdup(data->state.url);
/* if we are to retry, set the result to OK and consider the request
as done */
retry = TRUE;
result = CURLE_OK;
data->req.done = TRUE;
if(!newurl) {
result = CURLE_OUT_OF_MEMORY;
}
else {
/* if we are to retry, set the result to OK and consider the request
as done */
retry = TRUE;
result = CURLE_OK;
data->req.done = TRUE;
}
}
else
result = ret;