Skip to content

Commit

Permalink
vindexes: fix pooled collator buffer memory leak (#14621)
Browse files Browse the repository at this point in the history
Signed-off-by: Brendan Dougherty <[email protected]>
  • Loading branch information
vitess-bot[bot] committed Nov 27, 2023
1 parent 8621b75 commit 9de49af
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 9de49af

Please sign in to comment.