]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operate: Introduced operate_free() function
authorSteve Holme <steve_holme@hotmail.com>
Sun, 2 Feb 2014 15:37:28 +0000 (15:37 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Tue, 4 Feb 2014 20:15:50 +0000 (20:15 +0000)
src/tool_operate.c

index a4e8069c8a2dafbaa7d52fff0da3832e104c9cf5..2dace46f3b5679b2d588ca015b669b4fbdd4481b 100644 (file)
@@ -1834,13 +1834,16 @@ static int operate_do(struct Configurable *config, int argc, argv_item_t argv[])
   dumpeasysrc(config);
 #endif
 
+  return res;
+}
+
+static void operate_free(struct Configurable *config)
+{
   if(config->errors_fopened && config->errors)
     fclose(config->errors);
 
   /* Release metalink related resources here */
   clean_metalink(config);
-
-  return res;
 }
 
 int operate(struct Configurable *config, int argc, argv_item_t argv[])
@@ -1853,5 +1856,10 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
     return result;
 
   /* Perform the main operation */
-  return operate_do(config, argc, argv);
+  result = operate_do(config, argc, argv);
+
+  /* Perform the cleanup */
+  operate_free(config);
+
+  return result;
 }