Skip to content

Commit c787016

Browse files
committed
The actual segfault was caused by a double pfree(), but ISTM that
failing to find pg_hba.conf should be a fatal error anyway, so I increased the priority of the elog() from LOG to FATAL and refactored the code a little bit. Neil Conway
1 parent fb2d7a2 commit c787016

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/backend/libpq/hba.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.91 2002/12/11 22:17:11 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.92 2002/12/14 18:49:37 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -845,16 +845,13 @@ load_hba(void)
845845
file = AllocateFile(conf_file, "r");
846846
if (file == NULL)
847847
{
848-
/* The open of the config file failed. */
849-
elog(LOG, "load_hba: Unable to open authentication config file \"%s\": %m",
848+
elog(FATAL,
849+
"load_hba: Unable to open authentication config file \"%s\": %m",
850850
conf_file);
851-
pfree(conf_file);
852-
}
853-
else
854-
{
855-
hba_lines = tokenize_file(file);
856-
FreeFile(file);
857851
}
852+
853+
hba_lines = tokenize_file(file);
854+
FreeFile(file);
858855
pfree(conf_file);
859856
}
860857

0 commit comments

Comments
 (0)