mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08:00
tool_cfgable: Introduced config_free() function
This commit is contained in:
parent
67d14ab98f
commit
3b929b6a65
@ -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);
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user