From 52918fbc7a93ada80898463fdb7cb8e0f80ee817 Mon Sep 17 00:00:00 2001 From: tgl Date: Wed, 10 Sep 2008 19:16:22 +0000 Subject: [PATCH] Tweak newly added set_config_sourcefile() so that the target record isn't left corrupt if guc_strdup should fail. --- src/backend/utils/misc/guc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index df64ad5a58..c1a4dde97b 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -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; } -- 2.11.4.GIT