Browse Source

fix buffer leak in crypto io

Darien Raymond 8 years ago
parent
commit
d1e7e7002f
1 changed files with 2 additions and 0 deletions
  1. 2 0
      common/crypto/io.go

+ 2 - 0
common/crypto/io.go

@@ -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)