diff options
author | Max Kellermann <max@duempel.org> | 2009-01-02 10:48:55 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-02 10:48:55 +0100 |
commit | daf7c3db5aac09a8376f1c8ed499eb17202f77a9 (patch) | |
tree | ca912c4ff8c7985431a7e99cb3ea5a9393e09c2a /src/playlist_save.c | |
parent | 72255d580e23405375562160bf05fb55d3248f39 (diff) | |
download | mpd-daf7c3db5aac09a8376f1c8ed499eb17202f77a9.tar.gz mpd-daf7c3db5aac09a8376f1c8ed499eb17202f77a9.tar.xz mpd-daf7c3db5aac09a8376f1c8ed499eb17202f77a9.zip |
mapper: allocate the result of map_directory_child_fs(), map_song_fs()
Don't use fixed stack buffers.
Diffstat (limited to 'src/playlist_save.c')
-rw-r--r-- | src/playlist_save.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/playlist_save.c b/src/playlist_save.c index b6bc99369..4c9d0b2f4 100644 --- a/src/playlist_save.c +++ b/src/playlist_save.c @@ -32,9 +32,11 @@ playlist_print_song(FILE *file, const struct song *song) char tmp1[MPD_PATH_MAX], tmp2[MPD_PATH_MAX]; if (playlist_saveAbsolutePaths && song_in_database(song)) { - const char *path = map_song_fs(song, tmp1); - if (path != NULL) + char *path = map_song_fs(song); + if (path != NULL) { fprintf(file, "%s\n", path); + g_free(path); + } } else { song_get_url(song, tmp1); utf8_to_fs_charset(tmp2, tmp1); |