release buffer on write error

pull/215/head
v2ray 2016-07-16 11:12:53 +02:00
parent 17ea740e7e
commit e586f3c127
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 1 additions and 0 deletions

View File

@ -20,6 +20,7 @@ func Pipe(reader Reader, writer Writer) error {
err = writer.Write(buffer)
if err != nil {
log.Debug("IO: Pipe exits as ", err)
buffer.Release()
return err
}
}