From b54e18640ea4b713f8e40b22201a3f306592a6d2 Mon Sep 17 00:00:00 2001 From: Leandro Coutinho Date: Thu, 31 Mar 2022 14:27:10 +0200 Subject: [PATCH] lib670: avoid double check result Closes #8660 --- tests/libtest/lib670.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/libtest/lib670.c b/tests/libtest/lib670.c index e00a139230..974f2ec061 100644 --- a/tests/libtest/lib670.c +++ b/tests/libtest/lib670.c @@ -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);