mirror of
https://github.com/postgres/postgres.git
synced 2025-05-01 01:04:50 +03:00
Tweak newly added set_config_sourcefile() so that the target record
isn't left corrupt if guc_strdup should fail.
This commit is contained in:
parent
f867339c01
commit
b8646012d5
@ -10,7 +10,7 @@
|
|||||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.471 2008/09/10 18:09:19 alvherre Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.472 2008/09/10 19:16:22 tgl Exp $
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------
|
*--------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -5128,9 +5128,10 @@ set_config_sourcefile(const char *name, char *sourcefile, int sourceline)
|
|||||||
if (record == NULL)
|
if (record == NULL)
|
||||||
elog(ERROR, "unrecognized configuration parameter \"%s\"", name);
|
elog(ERROR, "unrecognized configuration parameter \"%s\"", name);
|
||||||
|
|
||||||
|
sourcefile = guc_strdup(elevel, sourcefile);
|
||||||
if (record->sourcefile)
|
if (record->sourcefile)
|
||||||
free(record->sourcefile);
|
free(record->sourcefile);
|
||||||
record->sourcefile = guc_strdup(elevel, sourcefile);
|
record->sourcefile = sourcefile;
|
||||||
record->sourceline = sourceline;
|
record->sourceline = sourceline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user