http: unify error handling in Curl_http()

Closes #19182
This commit is contained in:
x2018 2025-10-22 02:03:29 +08:00 committed by Daniel Stenberg
parent 30734e48d6
commit 7d5d0645e5
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -2936,8 +2936,10 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
char *pq = NULL;
if(data->state.up.query) {
pq = curl_maprintf("%s?%s", data->state.up.path, data->state.up.query);
if(!pq)
return CURLE_OUT_OF_MEMORY;
if(!pq) {
result = CURLE_OUT_OF_MEMORY;
goto out;
}
}
result = Curl_http_output_auth(data, data->conn, method, httpreq,
(pq ? pq : data->state.up.path), FALSE);