summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-04 15:11:23 +0100
committerMax Kellermann <max@duempel.org>2013-12-04 15:11:23 +0100
commitb978126bb0b22631306b095c7c6f4b2fdafe5557 (patch)
tree33dce09432c36a6d8d4962746d485e83cf3f4cd4 /src
parent9f51d190873b7d51682a87e5cf766ed76988214e (diff)
DirectorySave: don't duplicate string
Not necessary anymore for playlist_metadata_load().
Diffstat (limited to 'src')
-rw-r--r--src/DirectorySave.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/DirectorySave.cxx b/src/DirectorySave.cxx
index 6da961926..507f5ba47 100644
--- a/src/DirectorySave.cxx
+++ b/src/DirectorySave.cxx
@@ -29,7 +29,7 @@
#include "util/Error.hxx"
#include "util/Domain.hxx"
-#include <glib.h>
+#include <stddef.h>
#define DIRECTORY_DIR "directory: "
#define DIRECTORY_MTIME "mtime: "
@@ -146,18 +146,10 @@ directory_load(TextFile &file, Directory &directory, Error &error)
directory.AddSong(song);
} else if (StringStartsWith(line, PLAYLIST_META_BEGIN)) {
- /* duplicate the name, because
- playlist_metadata_load() will overwrite the
- buffer */
- char *name = g_strdup(line + sizeof(PLAYLIST_META_BEGIN) - 1);
-
+ const char *name = line + sizeof(PLAYLIST_META_BEGIN) - 1;
if (!playlist_metadata_load(file, directory.playlists,
- name, error)) {
- g_free(name);
+ name, error))
return false;
- }
-
- g_free(name);
} else {
error.Format(directory_domain,
"Malformed line: %s", line);