aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/varchar.c
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2022-12-01 11:26:32 -0800
committerJeff Davis <jdavis@postgresql.org>2022-12-01 11:49:15 -0800
commitedf12e7bbd0f5cf6b3c4f4d6b2dad8586b10dcc6 (patch)
tree08ddea0f9c7293749dccd50bd9915601fc2d149c /src/backend/utils/adt/varchar.c
parenta109a0bb50ad47812b8818e9c98e4f311672d659 (diff)
downloadpostgresql-edf12e7bbd0f5cf6b3c4f4d6b2dad8586b10dcc6.tar.gz
postgresql-edf12e7bbd0f5cf6b3c4f4d6b2dad8586b10dcc6.zip
Fix memory leak for hashing with nondeterministic collations.
Backpatch through 12, where nondeterministic collations were introduced (5e1963fb76). Backpatch-through: 12
Diffstat (limited to 'src/backend/utils/adt/varchar.c')
-rw-r--r--src/backend/utils/adt/varchar.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c
index 68e2e6f7a71..09c483d6ff8 100644
--- a/src/backend/utils/adt/varchar.c
+++ b/src/backend/utils/adt/varchar.c
@@ -1031,6 +1031,7 @@ hashbpchar(PG_FUNCTION_ARGS)
buf = palloc(bsize);
ucol_getSortKey(mylocale->info.icu.ucol,
uchar, ulen, buf, bsize);
+ pfree(uchar);
result = hash_any(buf, bsize);
@@ -1092,6 +1093,7 @@ hashbpcharextended(PG_FUNCTION_ARGS)
buf = palloc(bsize);
ucol_getSortKey(mylocale->info.icu.ucol,
uchar, ulen, buf, bsize);
+ pfree(uchar);
result = hash_any_extended(buf, bsize, PG_GETARG_INT64(1));