瀏覽代碼

release buffer in error case

Darien Raymond 7 年之前
父節點
當前提交
8d09d74224
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      common/net/connection.go

+ 1 - 0
common/net/connection.go

@@ -117,6 +117,7 @@ func (c *connection) Write(b []byte) (int, error) {
 
 func (c *connection) WriteMultiBuffer(mb buf.MultiBuffer) error {
 	if c.done.Done() {
+		buf.ReleaseMulti(mb)
 		return io.ErrClosedPipe
 	}