summaryrefslogtreecommitdiff
path: root/src/tool_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tool_main.c')
-rw-r--r--src/tool_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tool_main.c b/src/tool_main.c
index 1e9156aca..8a613cb21 100644
--- a/src/tool_main.c
+++ b/src/tool_main.c
@@ -132,6 +132,7 @@ static CURLcode main_init(struct GlobalConfig *config)
/* Initialise the global config */
config->showerror = -1; /* Will show errors */
+ config->errors = stderr; /* Default errors to stderr */
/* Allocate the initial operate config */
config->first = config->last = malloc(sizeof(struct OperationConfig));
@@ -179,6 +180,10 @@ static void free_config_fields(struct GlobalConfig *config)
{
Curl_safefree(config->trace_dump);
+ if(config->errors_fopened && config->errors)
+ fclose(config->errors);
+ config->errors = NULL;
+
if(config->trace_fopened && config->trace_stream)
fclose(config->trace_stream);
config->trace_stream = NULL;