diff options
author | Max Kellermann <max@duempel.org> | 2009-01-03 14:53:34 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-03 14:53:34 +0100 |
commit | 206611e2808d71c82664103d67f060ddcdf4d38d (patch) | |
tree | 0b52ccdbd704ad881e8b6627dd0f67e95c236420 /src/conf.c | |
parent | 63e240131e30bd77d5203bf29d624a02e04fd421 (diff) | |
download | mpd-206611e2808d71c82664103d67f060ddcdf4d38d.tar.gz mpd-206611e2808d71c82664103d67f060ddcdf4d38d.tar.xz mpd-206611e2808d71c82664103d67f060ddcdf4d38d.zip |
conf: use GLib instead of utils.h
Diffstat (limited to '')
-rw-r--r-- | src/conf.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/conf.c b/src/conf.c index 3c04a1d66..5bce0f029 100644 --- a/src/conf.c +++ b/src/conf.c @@ -24,6 +24,8 @@ #include <glib.h> #include <string.h> +#include <stdio.h> +#include <errno.h> #define MAX_STRING_SIZE MPD_PATH_MAX+80 @@ -84,22 +86,17 @@ config_param_free(gpointer data, G_GNUC_UNUSED gpointer user_data) ConfigParam *param = data; int i; - if (param->value) - free(param->value); + g_free(param->value); for (i = 0; i < param->numberOfBlockParams; i++) { - if (param->blockParams[i].name) { - free(param->blockParams[i].name); - } - if (param->blockParams[i].value) { - free(param->blockParams[i].value); - } + g_free(param->blockParams[i].name); + g_free(param->blockParams[i].value); } if (param->numberOfBlockParams) - free(param->blockParams); + g_free(param->blockParams); - free(param); + g_free(param); } static ConfigEntry * @@ -127,7 +124,7 @@ config_entry_free(gpointer data, G_GNUC_UNUSED gpointer user_data) g_slist_foreach(entry->params, config_param_free, NULL); g_slist_free(entry->params); - free(entry); + g_free(entry); } static ConfigEntry * @@ -417,7 +414,7 @@ ConfigParam *parseConfigFilePath(const char *name, int force) g_error("error parsing \"%s\" at line %i\n", name, param->line); - free(param->value); + g_free(param->value); param->value = path; return param; |