From 727c946d823750f4e7f33e3136a60aa8cda7ae95 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 20 Apr 2024 23:15:00 +0200 Subject: [PATCH] http: acknowledge a returned error code ... and do not overwrite it with a new value that could then hide the problem. Spotted by CodeSonar Closes #13434 --- lib/http.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/http.c b/lib/http.c index 9470d2ec62..92d991c1a7 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2238,9 +2238,11 @@ CURLcode Curl_http_req_complete(struct Curl_easy *data, /* end of headers */ result = Curl_dyn_addn(r, STRCONST("\r\n")); - Curl_pgrsSetUploadSize(data, req_clen); - if(announced_exp100) - result = http_exp100_add_reader(data); + if(!result) { + Curl_pgrsSetUploadSize(data, req_clen); + if(announced_exp100) + result = http_exp100_add_reader(data); + } out: if(!result) { -- 2.47.3