aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-14 02:14:24 +0200
committerMax Kellermann <max@duempel.org>2012-08-14 02:24:16 +0200
commit45ff3558358827ea60f6c0c8f2335e20c07293ed (patch)
tree950dd4a11dab483f9a7f80b6ea0965e54a5bba13
parentf8bf3afeae9ed757b516c64f62d8c1f3ef9ffaeb (diff)
downloadmpd-45ff3558358827ea60f6c0c8f2335e20c07293ed.tar.gz
mpd-45ff3558358827ea60f6c0c8f2335e20c07293ed.tar.xz
mpd-45ff3558358827ea60f6c0c8f2335e20c07293ed.zip
playlist_song: improve const-correctness
Diffstat (limited to '')
-rw-r--r--src/playlist_song.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/playlist_song.c b/src/playlist_song.c
index 85089a4d1..019ea8c55 100644
--- a/src/playlist_song.c
+++ b/src/playlist_song.c
@@ -112,7 +112,7 @@ playlist_check_translate_song(struct song *song, const char *base_uri,
/* already ok */
return song;
- char *uri = song->uri;
+ const char *uri = song->uri;
if (uri_has_scheme(uri)) {
if (uri_supported_scheme(uri))
@@ -149,13 +149,12 @@ playlist_check_translate_song(struct song *song, const char *base_uri,
base_uri = NULL;
}
+ char *allocated = NULL;
if (base_uri != NULL)
- uri = g_build_filename(base_uri, uri, NULL);
- else
- uri = g_strdup(uri);
+ uri = allocated = g_build_filename(base_uri, uri, NULL);
struct song *dest = playlist_check_load_song(song, uri, secure);
song_free(song);
- g_free(uri);
+ g_free(allocated);
return dest;
}