From: Daniel Stenberg Date: Sat, 20 Apr 2024 21:15:00 +0000 (+0200) Subject: http: acknowledge a returned error code X-Git-Tag: curl-8_8_0~174 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=727c946d823750f4e7f33e3136a60aa8cda7ae95;p=thirdparty%2Fcurl.git 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 --- 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) {