diff options
author | Max Kellermann <max@musicpd.org> | 2019-06-15 13:59:22 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-06-15 14:04:34 +0200 |
commit | be79b44dc873f7bff3bcdbb0353bb4036e140794 (patch) | |
tree | 612db01fb7ce619be77c3b7dd04be228cf665ec4 /src/input/plugins/ArchiveInputPlugin.cxx | |
parent | 17f207ffd145b9b55bd754e9ee34e655960674db (diff) |
archive/Lookup: pass const pointer
Diffstat (limited to 'src/input/plugins/ArchiveInputPlugin.cxx')
-rw-r--r-- | src/input/plugins/ArchiveInputPlugin.cxx | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/input/plugins/ArchiveInputPlugin.cxx b/src/input/plugins/ArchiveInputPlugin.cxx index 2ed3b96ed..d4bf86544 100644 --- a/src/input/plugins/ArchiveInputPlugin.cxx +++ b/src/input/plugins/ArchiveInputPlugin.cxx @@ -25,30 +25,22 @@ #include "../InputStream.hxx" #include "fs/Path.hxx" #include "Log.hxx" -#include "util/ScopeExit.hxx" - -#include <string.h> InputStreamPtr OpenArchiveInputStream(Path path, Mutex &mutex) { const ArchivePlugin *arplug; - char *pname = strdup(path.c_str()); - AtScopeExit(pname) { - free(pname); - }; - // archive_lookup will modify pname when true is returned ArchiveLookupResult l; try { - l = archive_lookup(pname); + l = archive_lookup(path.c_str()); if (l.archive.IsNull()) { return nullptr; } } catch (...) { LogFormat(LogLevel::DEBUG, std::current_exception(), - "not an archive, lookup %s failed", pname); + "not an archive, lookup %s failed", path.c_str()); return nullptr; } |