Skip to content

Commit b864601

Browse files
committed
Tweak newly added set_config_sourcefile() so that the target record
isn't left corrupt if guc_strdup should fail.
1 parent f867339 commit b864601

File tree

1 file changed

+3
-2
lines changed
  • src/backend/utils/misc

1 file changed

+3
-2
lines changed

src/backend/utils/misc/guc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.471 2008/09/10 18:09:19 alvherre Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.472 2008/09/10 19:16:22 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -5128,9 +5128,10 @@ set_config_sourcefile(const char *name, char *sourcefile, int sourceline)
51285128
if (record == NULL)
51295129
elog(ERROR, "unrecognized configuration parameter \"%s\"", name);
51305130

5131+
sourcefile = guc_strdup(elevel, sourcefile);
51315132
if (record->sourcefile)
51325133
free(record->sourcefile);
5133-
record->sourcefile = guc_strdup(elevel, sourcefile);
5134+
record->sourcefile = sourcefile;
51345135
record->sourceline = sourceline;
51355136
}
51365137

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy