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:53:53 -0800
commit47e1224d590ccbc0d745e812dffe2fa913201776 (patch)
tree6a97e80e3c4d6ccc90a576e7b9b1f522c6d67a04 /src/backend/utils/adt/varchar.c
parent7ec2bfe9e0315a296a70e0f716e6dbe3ecfcd530 (diff)
downloadpostgresql-47e1224d590ccbc0d745e812dffe2fa913201776.tar.gz
postgresql-47e1224d590ccbc0d745e812dffe2fa913201776.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 8fc84649f19..714cf22613d 100644
--- a/src/backend/utils/adt/varchar.c
+++ b/src/backend/utils/adt/varchar.c
@@ -1020,6 +1020,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);
@@ -1081,6 +1082,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));