1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-19 23:22:23 +03:00

Fix crash when reading 'timezone = unknown' from postgresql.conf during

SIGHUP; it's not OK for an assign_hook to return a non-malloc'd string.
Problem was introduced during timezone library rewrite.
This commit is contained in:
Tom Lane
2005-08-08 23:39:14 +00:00
parent 4cf0feae2c
commit 1c09a3c46d

View File

@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.105.4.1 2005/06/05 01:48:45 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.105.4.2 2005/08/08 23:39:14 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@@ -325,11 +325,14 @@ assign_timezone(const char *value, bool doit, GucSource source)
* pg_timezone_initialize() will eventually select a default * pg_timezone_initialize() will eventually select a default
* value from the environment. * value from the environment.
*/ */
if (doit)
{
const char *curzone = pg_get_current_timezone(); const char *curzone = pg_get_current_timezone();
if (curzone) if (curzone)
value = curzone; value = curzone;
} }
}
else else
{ {
/* /*