mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Fix memory leak for hashing with nondeterministic collations.
Backpatch through 12, where nondeterministic collations were
introduced (5e1963fb76
).
Backpatch-through: 12
This commit is contained in:
@ -303,6 +303,7 @@ hashtext(PG_FUNCTION_ARGS)
|
|||||||
buf = palloc(bsize);
|
buf = palloc(bsize);
|
||||||
ucol_getSortKey(mylocale->info.icu.ucol,
|
ucol_getSortKey(mylocale->info.icu.ucol,
|
||||||
uchar, ulen, buf, bsize);
|
uchar, ulen, buf, bsize);
|
||||||
|
pfree(uchar);
|
||||||
|
|
||||||
result = hash_any(buf, bsize);
|
result = hash_any(buf, bsize);
|
||||||
|
|
||||||
@ -360,6 +361,7 @@ hashtextextended(PG_FUNCTION_ARGS)
|
|||||||
buf = palloc(bsize);
|
buf = palloc(bsize);
|
||||||
ucol_getSortKey(mylocale->info.icu.ucol,
|
ucol_getSortKey(mylocale->info.icu.ucol,
|
||||||
uchar, ulen, buf, bsize);
|
uchar, ulen, buf, bsize);
|
||||||
|
pfree(uchar);
|
||||||
|
|
||||||
result = hash_any_extended(buf, bsize, PG_GETARG_INT64(1));
|
result = hash_any_extended(buf, bsize, PG_GETARG_INT64(1));
|
||||||
|
|
||||||
|
@ -1020,6 +1020,7 @@ hashbpchar(PG_FUNCTION_ARGS)
|
|||||||
buf = palloc(bsize);
|
buf = palloc(bsize);
|
||||||
ucol_getSortKey(mylocale->info.icu.ucol,
|
ucol_getSortKey(mylocale->info.icu.ucol,
|
||||||
uchar, ulen, buf, bsize);
|
uchar, ulen, buf, bsize);
|
||||||
|
pfree(uchar);
|
||||||
|
|
||||||
result = hash_any(buf, bsize);
|
result = hash_any(buf, bsize);
|
||||||
|
|
||||||
@ -1081,6 +1082,7 @@ hashbpcharextended(PG_FUNCTION_ARGS)
|
|||||||
buf = palloc(bsize);
|
buf = palloc(bsize);
|
||||||
ucol_getSortKey(mylocale->info.icu.ucol,
|
ucol_getSortKey(mylocale->info.icu.ucol,
|
||||||
uchar, ulen, buf, bsize);
|
uchar, ulen, buf, bsize);
|
||||||
|
pfree(uchar);
|
||||||
|
|
||||||
result = hash_any_extended(buf, bsize, PG_GETARG_INT64(1));
|
result = hash_any_extended(buf, bsize, PG_GETARG_INT64(1));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user