internal/poll: avoid memory leak in Writev

This commit is contained in:
taoyuanyuan 2019-05-20 07:22:35 +08:00
parent 1ab063ce53
commit e0b7f68447
1 changed files with 3 additions and 0 deletions

View File

@ -64,6 +64,9 @@ func (fd *FD) Writev(v *[][]byte) (int64, error) {
TestHookDidWritev(int(wrote))
n += int64(wrote)
consume(v, int64(wrote))
for i := range iovecs {
iovecs[i] = syscall.Iovec{}
}
if err != nil {
if err.(syscall.Errno) == syscall.EAGAIN {
if err = fd.pd.waitWrite(fd.isFile); err == nil {