← Commit list

6adefe8ad0

x2018
x2018
2025-11-03
SUCCESS Duration: 142s

Subject

multi: check the return value of strdup()

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/multi.c+10 -5
@@ -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;