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

Commit5380719

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 parentaad0926 commit5380719

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
@@ -1586,6 +1586,7 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
15861586
&buff_conv,buff_uchar,len_uchar);
15871587
icu_from_uchar(&result,buff_conv,len_conv);
15881588
pfree(buff_uchar);
1589+
pfree(buff_conv);
15891590
}
15901591
else
15911592
#endif
@@ -1709,6 +1710,7 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
17091710
&buff_conv,buff_uchar,len_uchar);
17101711
icu_from_uchar(&result,buff_conv,len_conv);
17111712
pfree(buff_uchar);
1713+
pfree(buff_conv);
17121714
}
17131715
else
17141716
#endif
@@ -1833,6 +1835,7 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
18331835
&buff_conv,buff_uchar,len_uchar);
18341836
icu_from_uchar(&result,buff_conv,len_conv);
18351837
pfree(buff_uchar);
1838+
pfree(buff_conv);
18361839
}
18371840
else
18381841
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp