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

Commit6151cb7

Browse files
committed
Replace static buf with palloc in str_time()
The function is used only once in the startup process, so the leakinto current memory context is harmless.This is a tiny step in making the server thread-safe.Reviewed-by: Robert HaasDiscussion:https://www.postgresql.org/message-id/7f86e06a-98c5-4ce3-8ec9-3885c8de0358@iki.fi
1 parent5bf948d commit6151cb7

File tree

1 file changed

+2
-2
lines changed
  • src/backend/access/transam

1 file changed

+2
-2
lines changed

‎src/backend/access/transam/xlog.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5168,9 +5168,9 @@ BootStrapXLOG(uint32 data_checksum_version)
51685168
staticchar*
51695169
str_time(pg_time_ttnow)
51705170
{
5171-
staticcharbuf[128];
5171+
char*buf=palloc(128);
51725172

5173-
pg_strftime(buf,sizeof(buf),
5173+
pg_strftime(buf,128,
51745174
"%Y-%m-%d %H:%M:%S %Z",
51755175
pg_localtime(&tnow,log_timezone));
51765176

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp