aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-02-23 13:44:59 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-02-23 13:44:59 +0000
commit665096e24c6f6632eaaf36fd322c8c9b92196212 (patch)
treec5b95fea331e86e59e9c60c8a8f9d096d819b57a /src
parentd6b9f054e96ddfe913e379301161ef02f12b07f3 (diff)
tool_main: Moved OperateConfig cleanup into main_free()
Diffstat (limited to 'src')
-rw-r--r--src/tool_main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tool_main.c b/src/tool_main.c
index 093969fc1..75fe628e4 100644
--- a/src/tool_main.c
+++ b/src/tool_main.c
@@ -161,11 +161,17 @@ static CURLcode main_init(struct GlobalConfig *config)
* This is the main global destructor for the app. Call this after
* _all_ libcurl usage is done.
*/
-static void main_free(void)
+static void main_free(struct GlobalConfig *config)
{
+ /* Main cleanup */
curl_global_cleanup();
convert_cleanup();
metalink_cleanup();
+
+ /* Free the config structures */
+ config_free(config->first);
+ config->first = NULL;
+ config->last = NULL;
}
/*
@@ -193,19 +199,13 @@ int main(int argc, char *argv[])
/* Start our curl operation */
result = operate(global.first, argc, argv);
- /* Perform the main cleanup */
- main_free();
- }
-
- if(global.first) {
#ifdef __SYMBIAN32__
if(global->first->showerror)
tool_pressanykey();
#endif
- /* Free the config structures */
- config_free(global.first);
- global.first = NULL;
+ /* Perform the main cleanup */
+ main_free(&global);
}
#ifdef __NOVELL_LIBC__