diff options
author | Max Kellermann <max@duempel.org> | 2009-09-24 21:40:05 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-09-24 21:40:05 +0200 |
commit | f3739a73af02a0152e842f2451358aa7aa962c1e (patch) | |
tree | 4e3bd2e3bcf504a14803a5b105d5b18ea3a8122c | |
parent | 1b227e01458e5db2b1ae80ae8501837f3206c1ac (diff) | |
download | mpd-f3739a73af02a0152e842f2451358aa7aa962c1e.tar.gz mpd-f3739a73af02a0152e842f2451358aa7aa962c1e.tar.xz mpd-f3739a73af02a0152e842f2451358aa7aa962c1e.zip |
conf: splitted function config_param_free()
-rw-r--r-- | src/conf.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/conf.c b/src/conf.c index 48c58b1ac..fe4b39fc3 100644 --- a/src/conf.c +++ b/src/conf.c @@ -142,10 +142,8 @@ config_new_param(const char *value, int line) } static void -config_param_free(gpointer data, G_GNUC_UNUSED gpointer user_data) +config_param_free(struct config_param *param) { - struct config_param *param = data; - g_free(param->value); for (unsigned i = 0; i < param->num_block_params; i++) { @@ -159,6 +157,14 @@ config_param_free(gpointer data, G_GNUC_UNUSED gpointer user_data) g_free(param); } +static void +config_param_free_callback(gpointer data, G_GNUC_UNUSED gpointer user_data) +{ + struct config_param *param = data; + + config_param_free(param); +} + static struct config_entry * config_entry_get(const char *name) { @@ -176,7 +182,8 @@ void config_global_finish(void) for (unsigned i = 0; i < G_N_ELEMENTS(config_entries); ++i) { struct config_entry *entry = &config_entries[i]; - g_slist_foreach(entry->params, config_param_free, NULL); + g_slist_foreach(entry->params, + config_param_free_callback, NULL); g_slist_free(entry->params); } } |