diff options
author | Max Kellermann <max@duempel.org> | 2013-12-04 15:07:45 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-12-04 15:07:45 +0100 |
commit | 9f51d190873b7d51682a87e5cf766ed76988214e (patch) | |
tree | cb7a4044759aba17dae749b8f65951938f77e241 /src | |
parent | 859184000fc13a7688cc6666df378af1470c690e (diff) | |
download | mpd-9f51d190873b7d51682a87e5cf766ed76988214e.tar.gz mpd-9f51d190873b7d51682a87e5cf766ed76988214e.tar.xz mpd-9f51d190873b7d51682a87e5cf766ed76988214e.zip |
PlaylistFile: use std::string for temporary string allocation
Diffstat (limited to 'src')
-rw-r--r-- | src/PlaylistFile.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx index 63a0807e9..8956bd3b5 100644 --- a/src/PlaylistFile.cxx +++ b/src/PlaylistFile.cxx @@ -156,10 +156,9 @@ LoadPlaylistFileInfo(PlaylistInfo &info, if (!StatFile(path_fs, st) || !S_ISREG(st.st_mode)) return false; - char *name = g_strndup(name_fs_str, - name_length + 1 - sizeof(PLAYLIST_FILE_SUFFIX)); - std::string name_utf8 = PathToUTF8(name); - g_free(name); + std::string name(name_fs_str, + name_length + 1 - sizeof(PLAYLIST_FILE_SUFFIX)); + std::string name_utf8 = PathToUTF8(name.c_str()); if (name_utf8.empty()) return false; |