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

Commitf967a1f

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 parent5524ef5 commitf967a1f

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
@@ -1551,6 +1551,7 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
15511551
&buff_conv,buff_uchar,len_uchar);
15521552
icu_from_uchar(&result,buff_conv,len_conv);
15531553
pfree(buff_uchar);
1554+
pfree(buff_conv);
15541555
}
15551556
else
15561557
#endif
@@ -1673,6 +1674,7 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
16731674
&buff_conv,buff_uchar,len_uchar);
16741675
icu_from_uchar(&result,buff_conv,len_conv);
16751676
pfree(buff_uchar);
1677+
pfree(buff_conv);
16761678
}
16771679
else
16781680
#endif
@@ -1796,6 +1798,7 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
17961798
&buff_conv,buff_uchar,len_uchar);
17971799
icu_from_uchar(&result,buff_conv,len_conv);
17981800
pfree(buff_uchar);
1801+
pfree(buff_conv);
17991802
}
18001803
else
18011804
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp