summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-11-08 14:13:30 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-11-08 14:54:03 +0100
commit9e9fef9e244e99dcf877ddbece461eaa8d609e2c (patch)
treeb04bdd0cb7a1d5afdf5ac1fdab3614fb30c675ae
parentef7c76ad82153786ace2f273af206e7cf8c39d91 (diff)
downloadcurl-9e9fef9e244e99dcf877ddbece461eaa8d609e2c.tar.gz
tool_operate: fclose stream only if fopened
Fixes torture test failures Follow-up to cc71d352651 Closes #7972
-rw-r--r--src/tool_operate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 835411c6b..f92b1bd37 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -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;