]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib670: avoid double check result
authorLeandro Coutinho <lescoutinhovr@gmail.com>
Thu, 31 Mar 2022 12:27:10 +0000 (14:27 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 31 Mar 2022 12:27:13 +0000 (14:27 +0200)
Closes #8660

tests/libtest/lib670.c

index e00a139230321d7f2e868493a07d44cab3966e5d..974f2ec061b8f6a03871ca00de7a759c29d4ef2f 100644 (file)
@@ -140,10 +140,6 @@ int test(char *URL)
   mime = curl_mime_init(pooh.easy);
   part = curl_mime_addpart(mime);
   result = curl_mime_name(part, name);
-  if(!result)
-    res = curl_mime_data_cb(part, (curl_off_t) 2, read_callback,
-                            NULL, NULL, &pooh);
-
   if(result) {
     fprintf(stderr,
             "Something went wrong when building the mime structure: %d\n",
@@ -151,6 +147,9 @@ int test(char *URL)
     goto test_cleanup;
   }
 
+  res = curl_mime_data_cb(part, (curl_off_t) 2, read_callback,
+                          NULL, NULL, &pooh);
+
   /* Bind mime data to its easy handle. */
   if(!res)
     test_setopt(pooh.easy, CURLOPT_MIMEPOST, mime);