From 31659b4a7ac8e736a2cb2812dff7635986ba0a2e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Sep 2025 00:46:08 +0200 Subject: [PATCH] http_add_connection_hd: respect previous error Pointed out by CodeSonar Closes #18472 --- lib/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.3