diff options
author | Max Kellermann <max@duempel.org> | 2014-02-24 19:38:30 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-24 20:19:34 +0100 |
commit | 25431f32a2e75b093b3207c6fce57c7904fc1a96 (patch) | |
tree | 2c2a10144af14601d21654f624826285b69384f9 /src | |
parent | 6ba1fe75689b394d39488b691b225e4269110b61 (diff) | |
download | mpd-25431f32a2e75b093b3207c6fce57c7904fc1a96.tar.gz mpd-25431f32a2e75b093b3207c6fce57c7904fc1a96.tar.xz mpd-25431f32a2e75b093b3207c6fce57c7904fc1a96.zip |
DecoderPlugin: free the container_scan() return value with delete[]
Diffstat (limited to '')
-rw-r--r-- | src/db/update/Container.cxx | 4 | ||||
-rw-r--r-- | src/decoder/DecoderPlugin.hxx | 2 | ||||
-rw-r--r-- | src/decoder/plugins/SidplayDecoderPlugin.cxx | 6 |
3 files changed, 5 insertions, 7 deletions
diff --git a/src/db/update/Container.cxx b/src/db/update/Container.cxx index 97cff332f..aedcf42ac 100644 --- a/src/db/update/Container.cxx +++ b/src/db/update/Container.cxx @@ -34,8 +34,6 @@ #include <sys/stat.h> -#include <glib.h> - Directory * UpdateWalk::MakeDirectoryIfModified(Directory &parent, const char *name, const FileInfo &info) @@ -120,7 +118,7 @@ UpdateWalk::UpdateContainerFile(Directory &directory, FormatDefault(update_domain, "added %s/%s", directory.GetPath(), vtrack); - g_free(vtrack); + delete[] vtrack; } if (tnum == 1) { diff --git a/src/decoder/DecoderPlugin.hxx b/src/decoder/DecoderPlugin.hxx index 716b01141..fd255ffb8 100644 --- a/src/decoder/DecoderPlugin.hxx +++ b/src/decoder/DecoderPlugin.hxx @@ -95,6 +95,8 @@ struct DecoderPlugin { * @return nullptr if there are no multiple files * a filename for every single track according to tnum (param 2) * do not include full pathname here, just the "virtual" file + * + * Free the return value with delete[]. */ char* (*container_scan)(Path path_fs, const unsigned int tnum); diff --git a/src/decoder/plugins/SidplayDecoderPlugin.cxx b/src/decoder/plugins/SidplayDecoderPlugin.cxx index 4ae9bc8cd..e3e3b8d96 100644 --- a/src/decoder/plugins/SidplayDecoderPlugin.cxx +++ b/src/decoder/plugins/SidplayDecoderPlugin.cxx @@ -22,7 +22,7 @@ #include "../DecoderAPI.hxx" #include "tag/TagHandler.hxx" #include "fs/Path.hxx" -#include "util/Alloc.hxx" +#include "util/FormatString.hxx" #include "util/Domain.hxx" #include "system/ByteOrder.hxx" #include "Log.hxx" @@ -406,9 +406,7 @@ sidplay_container_scan(Path path_fs, const unsigned int tnum) /* Construct container/tune path names, eg. Delta.sid/tune_001.sid */ if(tnum<=info.songs) { - char *subtune= g_strdup_printf( - SUBTUNE_PREFIX "%03u.sid", tnum); - return subtune; + return FormatNew(SUBTUNE_PREFIX "%03u.sid", tnum); } else return nullptr; } |