aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/conf.c15
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);
}
}