From 1373d40fead4a465525c7a0b7a286d271e24d793 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 19 Oct 2013 17:46:00 +0200 Subject: decoder/mpg123: use const_cast instead of g_strdup() --- src/decoder/Mpg123DecoderPlugin.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/decoder/Mpg123DecoderPlugin.cxx b/src/decoder/Mpg123DecoderPlugin.cxx index 928af39e6..524716d06 100644 --- a/src/decoder/Mpg123DecoderPlugin.cxx +++ b/src/decoder/Mpg123DecoderPlugin.cxx @@ -60,16 +60,14 @@ static bool mpd_mpg123_open(mpg123_handle *handle, const char *path_fs, AudioFormat &audio_format) { - char *path_dup; int error; int channels, encoding; long rate; /* mpg123_open() wants a writable string :-( */ - path_dup = g_strdup(path_fs); + char *const path2 = const_cast(path_fs); - error = mpg123_open(handle, path_dup); - g_free(path_dup); + error = mpg123_open(handle, path2); if (error != MPG123_OK) { FormatWarning(mpg123_domain, "libmpg123 failed to open %s: %s", -- cgit v1.2.3