release buffer on error

pull/700/head
Darien Raymond 2017-11-07 22:33:16 +01:00
parent cab5c10fc2
commit ead3fa09e5
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 1 additions and 0 deletions

View File

@ -104,6 +104,7 @@ func (r *StreamReader) Read() (buf.MultiBuffer, error) {
if err := b.AppendSupplier(func(bb []byte) (int, error) {
return r.reader.Read(bb[:readLen])
}); err != nil {
b.Release()
mb.Release()
return nil, err
}