]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: acknowledge a returned error code
authorDaniel Stenberg <daniel@haxx.se>
Sat, 20 Apr 2024 21:15:00 +0000 (23:15 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 21 Apr 2024 08:49:48 +0000 (10:49 +0200)
... and do not overwrite it with a new value that could then hide the
problem.

Spotted by CodeSonar

Closes #13434

lib/http.c

index 9470d2ec62404f44245c92fa9a13ebcb145dda79..92d991c1a7c3feb5b6c05c2cc4191d1ebc10da92 100644 (file)
@@ -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) {