]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http_add_connection_hd: respect previous error
authorDaniel Stenberg <daniel@haxx.se>
Wed, 3 Sep 2025 22:46:08 +0000 (00:46 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 4 Sep 2025 06:26:17 +0000 (08:26 +0200)
Pointed out by CodeSonar

Closes #18472

lib/http.c

index 67f88736e03e730170a23e5c19ffd85cce3d930c..e01de6f4772c9a0fe544d3bfc877113d1a63abe1 100644 (file)
@@ -2657,7 +2657,7 @@ static CURLcode http_add_connection_hd(struct Curl_easy *data,
   if(!result && data->state.http_hd_h2_settings) {
     result = curlx_dyn_addf(req, "%s%s", sep, "HTTP2-Settings");
   }
-  if(rlen < curlx_dyn_len(req))
+  if(!result && (rlen < curlx_dyn_len(req)))
     result = curlx_dyn_addn(req, STRCONST("\r\n"));
 
   free(custom_val);