diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-11-08 14:13:30 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-11-08 14:54:03 +0100 |
commit | 9e9fef9e244e99dcf877ddbece461eaa8d609e2c (patch) | |
tree | b04bdd0cb7a1d5afdf5ac1fdab3614fb30c675ae | |
parent | ef7c76ad82153786ace2f273af206e7cf8c39d91 (diff) | |
download | curl-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.c | 2 |
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; |