mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
The redirected error stream was closed before curl_easy_cleanup() was made,
and when VERBOSE was enabled, that used the stream. Also, the stream was closed even if we looped to get more files. Corrects Dustin Boswell's bug report #441610
This commit is contained in:
parent
5de39884c3
commit
f112cc14b9
10
src/main.c
10
src/main.c
@ -1963,11 +1963,6 @@ operate(struct Configurable *config, int argc, char *argv[])
|
||||
fprintf(config->errors, "curl: (%d) %s\n", res, errorbuffer);
|
||||
#endif
|
||||
|
||||
if((config->errors != stderr) &&
|
||||
(config->errors != stdout))
|
||||
/* it wasn't directed to stdout or stderr so close the file! */
|
||||
fclose(config->errors);
|
||||
|
||||
if(config->headerfile && !headerfilep && heads.stream)
|
||||
fclose(heads.stream);
|
||||
|
||||
@ -2012,6 +2007,11 @@ operate(struct Configurable *config, int argc, char *argv[])
|
||||
/* cleanup the curl handle! */
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
if((config->errors != stderr) &&
|
||||
(config->errors != stdout))
|
||||
/* it wasn't directed to stdout or stderr so close the file! */
|
||||
fclose(config->errors);
|
||||
|
||||
main_free(); /* cleanup */
|
||||
|
||||
return res;
|
||||
|
Loading…
Reference in New Issue
Block a user