Skip to content

Commit

Permalink
Merge pull request #22448 from andreimatei/fix-acc-leak
Browse files Browse the repository at this point in the history
pgwire: fix memory account leak
  • Loading branch information
andreimatei committed Feb 7, 2018
2 parents fd167ce + f86d95e commit 0c577f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/sql/pgwire/v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,12 @@ func (c *v3Conn) serve(ctx context.Context, draining func() bool, reserved mon.B
c.writeBuf.writeTerminatedString(key)
c.writeBuf.writeTerminatedString(value)
if err := c.writeBuf.finishMsg(c.wr); err != nil {
reserved.Close(ctx)
return err
}
}
if err := c.wr.Flush(); err != nil {
reserved.Close(ctx)
return err
}

Expand Down

0 comments on commit 0c577f2

Please sign in to comment.