aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-02-02 15:37:28 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-02-04 20:15:50 +0000
commit7d242658ac25826b8d648df366a7b13f49719675 (patch)
tree668b6e7ba1625cc684c9b09b9c0aeef768f09a42 /src
parentdde308108501ba1e7ebf817b5e5eaa61fa1031b6 (diff)
tool_operate: Introduced operate_free() function
Diffstat (limited to 'src')
-rw-r--r--src/tool_operate.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index a4e8069c8..2dace46f3 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -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;
}