Skip to content

Commit

Permalink
[release-17.0] vindexes: fix pooled collator buffer memory leak (#14621
Browse files Browse the repository at this point in the history
…) (#14623)

Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
  • Loading branch information
vitess-bot[bot] authored Nov 28, 2023
1 parent 29d3784 commit 3564a50
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/vt/vtgate/vindexes/unicode.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ import (

func unicodeHash(hashFunc func([]byte) []byte, key sqltypes.Value) ([]byte, error) {
collator := collatorPool.Get().(*pooledCollator)
defer collatorPool.Put(collator)
defer func() {
collator.buf.Reset()
collatorPool.Put(collator)
}()

keyBytes, err := key.ToBytes()
if err != nil {
Expand Down

0 comments on commit 3564a50

Please sign in to comment.