From 77a11337230ac026a5519b69018fa76fc0462fe9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 15 Oct 2013 21:20:18 +0200 Subject: PlaylistRegistry: use std::string for temporary allocation --- src/PlaylistRegistry.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/PlaylistRegistry.cxx b/src/PlaylistRegistry.cxx index fe6b4cd33..2a4cf8c5d 100644 --- a/src/PlaylistRegistry.cxx +++ b/src/PlaylistRegistry.cxx @@ -243,10 +243,8 @@ playlist_list_open_stream_mime(struct input_stream *is, const char *full_mime) return nullptr; /* probe only the portion before the semicolon*/ - char *mime = g_strndup(full_mime, semicolon - full_mime); - auto playlist = playlist_list_open_stream_mime2(is, mime); - g_free(mime); - return playlist; + const std::string mime(full_mime, semicolon); + return playlist_list_open_stream_mime2(is, mime.c_str()); } static SongEnumerator * -- cgit v1.2.3