]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operate: fclose stream only if fopened
authorDaniel Stenberg <daniel@haxx.se>
Mon, 8 Nov 2021 13:13:30 +0000 (14:13 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 8 Nov 2021 13:54:03 +0000 (14:54 +0100)
Fixes torture test failures
Follow-up to cc71d352651

Closes #7972

src/tool_operate.c

index 835411c6bf6c72f1455eda2d635cdc7abc816523..f92b1bd37ed68883c1533b28191e101117e64b6c 100644 (file)
@@ -881,7 +881,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
           result = add_per_transfer(&per);
         if(result || !curl) {
           curl_easy_cleanup(curl);
-          if(etag_save->stream)
+          if(etag_save->fopened)
             fclose(etag_save->stream);
           result = CURLE_OUT_OF_MEMORY;
           break;