From: Daniel Stenberg Date: Wed, 3 Sep 2025 22:46:08 +0000 (+0200) Subject: http_add_connection_hd: respect previous error X-Git-Tag: curl-8_16_0~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=31659b4a7ac8e736a2cb2812dff7635986ba0a2e;p=thirdparty%2Fcurl.git http_add_connection_hd: respect previous error Pointed out by CodeSonar Closes #18472 --- diff --git a/lib/http.c b/lib/http.c index 67f88736e0..e01de6f477 100644 --- a/lib/http.c +++ b/lib/http.c @@ -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);