decoder/Thread: delete the InputStream on error

Fixes memory leak after stream failure.  See
https://bugs.musicpd.org/view.php?id=4562
This commit is contained in:
Max Kellermann 2016-08-05 18:15:30 +02:00
parent 588303b78d
commit d042ab87da
2 changed files with 2 additions and 0 deletions

1
NEWS
View File

@ -9,6 +9,7 @@ ver 0.19.18 (not yet released)
- sidplay: allow building with libsidplayfp instead of libsidplay2 - sidplay: allow building with libsidplayfp instead of libsidplay2
* output * output
- shout: recognize setting "encoder" instead of "encoding" - shout: recognize setting "encoder" instead of "encoding"
* fix memory leak after stream failure
* fix build failure with Boost 1.61 * fix build failure with Boost 1.61
* require gcc 4.7 or newer * require gcc 4.7 or newer

View File

@ -98,6 +98,7 @@ decoder_input_stream_open(DecoderControl &dc, const char *uri)
if (!is->Check(error)) { if (!is->Check(error)) {
dc.Unlock(); dc.Unlock();
delete is;
LogError(error); LogError(error);
return nullptr; return nullptr;