Fix std::string read after free in read_stream_art
This commit is contained in:
parent
318f80d113
commit
9f16c798d0
@ -266,12 +266,12 @@ find_stream_art(const char *directory, Mutex &mutex, Cond &cond)
|
||||
static CommandResult
|
||||
read_stream_art(Response &r, const char *uri, size_t offset)
|
||||
{
|
||||
const char *art_directory = PathTraitsUTF8::GetParent(uri).c_str();
|
||||
std::string art_directory = PathTraitsUTF8::GetParent(uri);
|
||||
|
||||
Mutex mutex;
|
||||
Cond cond;
|
||||
|
||||
InputStreamPtr is = find_stream_art(art_directory, mutex, cond);
|
||||
InputStreamPtr is = find_stream_art(art_directory.c_str(), mutex, cond);
|
||||
|
||||
if (is == nullptr) {
|
||||
r.Error(ACK_ERROR_NO_EXIST, "No file exists");
|
||||
|
Loading…
Reference in New Issue
Block a user