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:55:59 -0800
commit9377b4f30a14e1c79183b3138fa88fc99d4a872a (patch)
tree1fcd2f50255bc0b22dbc71666f494f402b9d9626 /src/backend/utils/adt/varchar.c
parente10799aa252c2232a3d4f73f4875532423f3f7b4 (diff)
downloadpostgresql-9377b4f30a14e1c79183b3138fa88fc99d4a872a.tar.gz
postgresql-9377b4f30a14e1c79183b3138fa88fc99d4a872a.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 bbeb0a2653a..63a2073a429 100644
--- a/src/backend/utils/adt/varchar.c
+++ b/src/backend/utils/adt/varchar.c
@@ -1030,6 +1030,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);
@@ -1091,6 +1092,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));