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:43 -0800
commitf98c4fb1dd8d117b719963677f0be002cbc5129b (patch)
treed737bb649e76cb7fa248d82c98c4fa91ee5481b9 /src/backend/utils/adt/varchar.c
parentaf6a76931634780fd5a67f2e1dee84a269e1f14a (diff)
downloadpostgresql-f98c4fb1dd8d117b719963677f0be002cbc5129b.tar.gz
postgresql-f98c4fb1dd8d117b719963677f0be002cbc5129b.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 416c73f7286..1540d36c4ca 100644
--- a/src/backend/utils/adt/varchar.c
+++ b/src/backend/utils/adt/varchar.c
@@ -1021,6 +1021,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);
@@ -1082,6 +1083,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));