Skip to content

Commit

Permalink
pgwire: fix memory account leak
Browse files Browse the repository at this point in the history
Want unique_ptr.

Release note: None
  • Loading branch information
andreimatei committed Feb 7, 2018
1 parent 533e45e commit f86d95e
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 f86d95e

Please sign in to comment.