From: x2018 Date: Tue, 21 Oct 2025 18:03:29 +0000 (+0800) Subject: http: unify error handling in Curl_http() X-Git-Tag: curl-8_17_0~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d5d0645e5562f65005488fbc7fd270a71239a5f;p=thirdparty%2Fcurl.git http: unify error handling in Curl_http() Closes #19182 --- diff --git a/lib/http.c b/lib/http.c index 172a091668..44d36b9a84 100644 --- a/lib/http.c +++ b/lib/http.c @@ -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);