aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-05 18:26:45 +0100
committerMax Kellermann <max@duempel.org>2008-11-05 18:26:45 +0100
commit2a1a37107f5498b19a1336d73ea724d9d08f0588 (patch)
tree56ed655fb9c14d4afabc912ee023bace2d2ac30e /src
parent6a7a26fe42b772347833136666b237ad6d8a51dc (diff)
downloadmpd-2a1a37107f5498b19a1336d73ea724d9d08f0588.tar.gz
mpd-2a1a37107f5498b19a1336d73ea724d9d08f0588.tar.xz
mpd-2a1a37107f5498b19a1336d73ea724d9d08f0588.zip
path: don't allocate charset twice
Make the local variable "charset" const, and don't duplicate its value. It is already duplicated by path_set_fs_charset().
Diffstat (limited to 'src')
-rw-r--r--src/path.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/path.c b/src/path.c
index 7e24fbf8f..df7cfdfb6 100644
--- a/src/path.c
+++ b/src/path.c
@@ -89,22 +89,20 @@ const char *path_get_fs_charset(void)
void path_global_init(void)
{
ConfigParam *fs_charset_param = getConfigParam(CONF_FS_CHARSET);
-
- char *charset = NULL;
+ const char *charset = NULL;
if (fs_charset_param) {
- charset = xstrdup(fs_charset_param->value);
+ charset = fs_charset_param->value;
} else {
const gchar **encodings;
g_get_filename_charsets(&encodings);
if (encodings[0] != NULL && *encodings[0] != '\0')
- charset = g_strdup(encodings[0]);
+ charset = encodings[0];
}
if (charset) {
path_set_fs_charset(charset);
- free(charset);
} else {
WARNING("setting filesystem charset to ISO-8859-1\n");
path_set_fs_charset("ISO-8859-1");