fix buffer leak in crypto io

pull/700/head
Darien Raymond 2017-11-07 11:39:54 +01:00
parent 4761139fbc
commit d1e7e7002f
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 2 additions and 0 deletions

View File

@ -51,6 +51,8 @@ func (w *CryptionWriter) Write(data []byte) (int, error) {
}
func (w *CryptionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
defer mb.Release()
bs := mb.ToNetBuffers()
for _, b := range bs {
w.stream.XORKeyStream(b, b)