Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3a54eb1

Browse files
committed
Fix memory leak with lower, upper and initcap with ICU-provided collations
The leak happens in str_tolower, str_toupper and str_initcap, which areused in several places including their equivalent SQL-level functions,and can only be triggered when using an ICU-provided collation whenconverting the input string.b615920 fixed a similar leak. Backpatch down 10 where ICU collationshave been introduced.Author: Konstantin KnizhnikDiscussion:https://postgr.es/m/94c0ad0a-cbc2-e4a3-7829-2bdeaf9146db@postgrespro.ruBackpatch-through: 10
1 parentf63a5ea commit3a54eb1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎src/backend/utils/adt/formatting.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,7 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
15841584
&buff_conv,buff_uchar,len_uchar);
15851585
icu_from_uchar(&result,buff_conv,len_conv);
15861586
pfree(buff_uchar);
1587+
pfree(buff_conv);
15871588
}
15881589
else
15891590
#endif
@@ -1707,6 +1708,7 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
17071708
&buff_conv,buff_uchar,len_uchar);
17081709
icu_from_uchar(&result,buff_conv,len_conv);
17091710
pfree(buff_uchar);
1711+
pfree(buff_conv);
17101712
}
17111713
else
17121714
#endif
@@ -1831,6 +1833,7 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
18311833
&buff_conv,buff_uchar,len_uchar);
18321834
icu_from_uchar(&result,buff_conv,len_conv);
18331835
pfree(buff_uchar);
1836+
pfree(buff_conv);
18341837
}
18351838
else
18361839
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp