diff options
| author | Steve Holme <steve_holme@hotmail.com> | 2014-02-07 19:29:46 +0000 | 
|---|---|---|
| committer | Steve Holme <steve_holme@hotmail.com> | 2014-02-07 21:22:46 +0000 | 
| commit | 3b929b6a6589a678da43e1a44bb02a70b50deae3 (patch) | |
| tree | a560a59510a40d77a65c5701fc59a81de08ab7ba | |
| parent | 67d14ab98f8b819ee6f5e6a4a2770d311c6bf13b (diff) | |
tool_cfgable: Introduced config_free() function
| -rw-r--r-- | src/tool_cfgable.c | 8 | ||||
| -rw-r--r-- | src/tool_cfgable.h | 2 | ||||
| -rw-r--r-- | src/tool_main.c | 4 | 
3 files changed, 10 insertions, 4 deletions
diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c index c47978612..9ef3f87b5 100644 --- a/src/tool_cfgable.c +++ b/src/tool_cfgable.c @@ -43,7 +43,7 @@ void init_config(struct Configurable* config)    config->proto_redir_present = FALSE;  } -void free_config_fields(struct Configurable *config) +static void free_config_fields(struct Configurable *config)  {    struct getout *urlnode; @@ -150,3 +150,9 @@ void free_config_fields(struct Configurable *config)    Curl_safefree(config->libcurl);  } + +void config_free(struct Configurable *config) +{ +  free_config_fields(config); +  free(config); +} diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index fa4ec7ec0..6331de2d2 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -217,6 +217,6 @@ struct Configurable {  }; /* struct Configurable */  void init_config(struct Configurable* config); -void free_config_fields(struct Configurable *config); +void config_free(struct Configurable* config);  #endif /* HEADER_CURL_TOOL_CFGABLE_H */ diff --git a/src/tool_main.c b/src/tool_main.c index a46877b3e..1d96436b1 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -197,8 +197,8 @@ int main(int argc, char *argv[])  #endif      /* Free the config structure */ -    free_config_fields(config); -    Curl_safefree(config); +    config_free(config); +    config = NULL;    }    else {      helpf(stderr, "error initializing curl\n");  | 
