Commit 25431f32 authored by Max Kellermann's avatar Max Kellermann

DecoderPlugin: free the container_scan() return value with delete[]

parent 6ba1fe75
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <glib.h>
Directory * Directory *
UpdateWalk::MakeDirectoryIfModified(Directory &parent, const char *name, UpdateWalk::MakeDirectoryIfModified(Directory &parent, const char *name,
const FileInfo &info) const FileInfo &info)
...@@ -120,7 +118,7 @@ UpdateWalk::UpdateContainerFile(Directory &directory, ...@@ -120,7 +118,7 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
FormatDefault(update_domain, "added %s/%s", FormatDefault(update_domain, "added %s/%s",
directory.GetPath(), vtrack); directory.GetPath(), vtrack);
g_free(vtrack); delete[] vtrack;
} }
if (tnum == 1) { if (tnum == 1) {
......
...@@ -95,6 +95,8 @@ struct DecoderPlugin { ...@@ -95,6 +95,8 @@ struct DecoderPlugin {
* @return nullptr if there are no multiple files * @return nullptr if there are no multiple files
* a filename for every single track according to tnum (param 2) * a filename for every single track according to tnum (param 2)
* do not include full pathname here, just the "virtual" file * 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); char* (*container_scan)(Path path_fs, const unsigned int tnum);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "../DecoderAPI.hxx" #include "../DecoderAPI.hxx"
#include "tag/TagHandler.hxx" #include "tag/TagHandler.hxx"
#include "fs/Path.hxx" #include "fs/Path.hxx"
#include "util/Alloc.hxx" #include "util/FormatString.hxx"
#include "util/Domain.hxx" #include "util/Domain.hxx"
#include "system/ByteOrder.hxx" #include "system/ByteOrder.hxx"
#include "Log.hxx" #include "Log.hxx"
...@@ -406,9 +406,7 @@ sidplay_container_scan(Path path_fs, const unsigned int tnum) ...@@ -406,9 +406,7 @@ sidplay_container_scan(Path path_fs, const unsigned int tnum)
/* Construct container/tune path names, eg. /* Construct container/tune path names, eg.
Delta.sid/tune_001.sid */ Delta.sid/tune_001.sid */
if(tnum<=info.songs) { if(tnum<=info.songs) {
char *subtune= g_strdup_printf( return FormatNew(SUBTUNE_PREFIX "%03u.sid", tnum);
SUBTUNE_PREFIX "%03u.sid", tnum);
return subtune;
} else } else
return nullptr; return nullptr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment