mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
tool_main: Changed stack based config struct to be heap based
This commit is contained in:
parent
2f89a61cc0
commit
cf80b85b66
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "tool_cfgable.h"
|
#include "tool_cfgable.h"
|
||||||
#include "tool_convert.h"
|
#include "tool_convert.h"
|
||||||
|
#include "tool_msgs.h"
|
||||||
#include "tool_operate.h"
|
#include "tool_operate.h"
|
||||||
#include "tool_panykey.h"
|
#include "tool_panykey.h"
|
||||||
#include "tool_vms.h"
|
#include "tool_vms.h"
|
||||||
@ -120,10 +121,7 @@ void memory_tracking_init(void)
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
struct Configurable config;
|
struct Configurable *config;
|
||||||
|
|
||||||
/* Initialise the config */
|
|
||||||
init_config(&config);
|
|
||||||
|
|
||||||
main_checkfds();
|
main_checkfds();
|
||||||
|
|
||||||
@ -134,15 +132,29 @@ int main(int argc, char *argv[])
|
|||||||
/* Initialize memory tracking */
|
/* Initialize memory tracking */
|
||||||
memory_tracking_init();
|
memory_tracking_init();
|
||||||
|
|
||||||
/* Start our curl operation */
|
/* Allocate the initial config */
|
||||||
res = operate(&config, argc, argv);
|
config = malloc(sizeof(struct Configurable));
|
||||||
|
|
||||||
|
if(config) {
|
||||||
|
/* Initialise the config */
|
||||||
|
init_config(config);
|
||||||
|
|
||||||
|
/* Start our curl operation */
|
||||||
|
res = operate(config, argc, argv);
|
||||||
|
|
||||||
#ifdef __SYMBIAN32__
|
#ifdef __SYMBIAN32__
|
||||||
if(config.showerror)
|
if(config->showerror)
|
||||||
tool_pressanykey();
|
tool_pressanykey();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
free_config_fields(&config);
|
/* Free the config structure */
|
||||||
|
free_config_fields(config);
|
||||||
|
Curl_safefree(config);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
helpf(stderr, "error initializing curl\n");
|
||||||
|
res = CURLE_FAILED_INIT;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __NOVELL_LIBC__
|
#ifdef __NOVELL_LIBC__
|
||||||
if(getenv("_IN_NETWARE_BASH_") == NULL)
|
if(getenv("_IN_NETWARE_BASH_") == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user