Skip to content

Commit

Permalink
Merge pull request #131 from Shopify/fix-unicode-loose-vindex-memory-…
Browse files Browse the repository at this point in the history
…leak

Backport: vindexes: fix pooled collator buffer memory leak
  • Loading branch information
brendar authored Nov 27, 2023
2 parents f757ff2 + 437a2a9 commit ab9da01
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 ab9da01

Please sign in to comment.