]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: unify error handling in Curl_http()
authorx2018 <xkernel.wang@foxmail.com>
Tue, 21 Oct 2025 18:03:29 +0000 (02:03 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 21 Oct 2025 21:19:39 +0000 (23:19 +0200)
Closes #19182

lib/http.c

index 172a091668677ad8023f736e00ac86828ac50475..44d36b9a847ad3077d1d68b8995c2932409b3af5 100644 (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);