1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 00:28:48 -05:00

tool_operate: Introduced operate_free() function

This commit is contained in:
Steve Holme 2014-02-02 15:37:28 +00:00
parent dde3081085
commit 7d242658ac

View File

@ -1834,13 +1834,16 @@ static int operate_do(struct Configurable *config, int argc, argv_item_t argv[])
dumpeasysrc(config); dumpeasysrc(config);
#endif #endif
return res;
}
static void operate_free(struct Configurable *config)
{
if(config->errors_fopened && config->errors) if(config->errors_fopened && config->errors)
fclose(config->errors); fclose(config->errors);
/* Release metalink related resources here */ /* Release metalink related resources here */
clean_metalink(config); clean_metalink(config);
return res;
} }
int operate(struct Configurable *config, int argc, argv_item_t argv[]) 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; return result;
/* Perform the main operation */ /* Perform the main operation */
return operate_do(config, argc, argv); result = operate_do(config, argc, argv);
/* Perform the cleanup */
operate_free(config);
return result;
} }