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

Commitac50f84

Browse files
committed
Fix misuse of TextDatumGetCString().
"TextDatumGetCString(PG_GETARG_TEXT_P(x))" is formally wrong: a text*is not a Datum. Although this coding will accidentally fail to fail onall known platforms, it risks leaking memory if a detoast step is needed,unlike "TextDatumGetCString(PG_GETARG_DATUM(x))" which is what's usedelsewhere. Make pg_get_object_address() fall in line with other uses.Noted while reviewing two-arg current_setting() patch.
1 parent10fb48d commitac50f84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/catalog/objectaddress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1831,7 +1831,7 @@ textarray_to_strvaluelist(ArrayType *arr)
18311831
Datum
18321832
pg_get_object_address(PG_FUNCTION_ARGS)
18331833
{
1834-
char*ttype=TextDatumGetCString(PG_GETARG_TEXT_P(0));
1834+
char*ttype=TextDatumGetCString(PG_GETARG_DATUM(0));
18351835
ArrayType*namearr=PG_GETARG_ARRAYTYPE_P(1);
18361836
ArrayType*argsarr=PG_GETARG_ARRAYTYPE_P(2);
18371837
intitype;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp