mirror of https://github.com/v2ray/v2ray-core
release buffer on error
parent
cab5c10fc2
commit
ead3fa09e5
|
@ -104,6 +104,7 @@ func (r *StreamReader) Read() (buf.MultiBuffer, error) {
|
||||||
if err := b.AppendSupplier(func(bb []byte) (int, error) {
|
if err := b.AppendSupplier(func(bb []byte) (int, error) {
|
||||||
return r.reader.Read(bb[:readLen])
|
return r.reader.Read(bb[:readLen])
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
b.Release()
|
||||||
mb.Release()
|
mb.Release()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue