diff options
Diffstat (limited to 'src/backend/utils/error/elog.c')
-rw-r--r-- | src/backend/utils/error/elog.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index eb62ff5054c..9c7489a9bb2 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -2364,10 +2364,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata) */ char *hostport; - int alloclen = strlen(MyProcPort->remote_host) + - strlen(MyProcPort->remote_port) + 3; - hostport = palloc(alloclen); - sprintf(hostport, "%s(%s)", MyProcPort->remote_host, MyProcPort->remote_port); + hostport = psprintf("%s(%s)", MyProcPort->remote_host, MyProcPort->remote_port); appendStringInfo(buf, "%*s", padding, hostport); pfree(hostport); } |