← Commit list

231f0a2eec

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

Subject

http: 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/http.c+5 -1
@@ -4039,9 +4039,13 @@ static CURLcode http_on_response(struct Curl_easy *data,
goto out;
}
data->state.disableexpect = TRUE;
+ Curl_req_abort_sending(data);
DEBUGASSERT(!data->req.newurl);
data->req.newurl = strdup(data->state.url);
- Curl_req_abort_sending(data);
+ if(!data->req.newurl) {
+ result = CURLE_OUT_OF_MEMORY;
+ goto out;
+ }
}
else if(data->set.http_keep_sending_on_error) {
infof(data, "HTTP error before end of send, keep sending");