aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-09-10 19:16:22 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-09-10 19:16:22 +0000
commitb8646012d560f3364b0076bb528866f869c3a61e (patch)
treee13bc65dd106dd7c3f7cb537d0e0a23574c40d42 /src
parentf867339c0148381eb1d01f93ab5c79f9d10211de (diff)
downloadpostgresql-b8646012d560f3364b0076bb528866f869c3a61e.tar.gz
postgresql-b8646012d560f3364b0076bb528866f869c3a61e.zip
Tweak newly added set_config_sourcefile() so that the target record
isn't left corrupt if guc_strdup should fail.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/misc/guc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 4cc1ef3a94e..a33cc0e41cf 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* 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)
elog(ERROR, "unrecognized configuration parameter \"%s\"", name);
+ sourcefile = guc_strdup(elevel, sourcefile);
if (record->sourcefile)
free(record->sourcefile);
- record->sourcefile = guc_strdup(elevel, sourcefile);
+ record->sourcefile = sourcefile;
record->sourceline = sourceline;
}