mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
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
This commit is contained in:
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.87.2.1 2002/12/11 22:17:31 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.87.2.2 2002/12/14 18:49:43 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -845,16 +845,13 @@ load_hba(void)
|
|||||||
file = AllocateFile(conf_file, "r");
|
file = AllocateFile(conf_file, "r");
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
{
|
{
|
||||||
/* The open of the config file failed. */
|
elog(FATAL,
|
||||||
elog(LOG, "load_hba: Unable to open authentication config file \"%s\": %m",
|
"load_hba: Unable to open authentication config file \"%s\": %m",
|
||||||
conf_file);
|
conf_file);
|
||||||
pfree(conf_file);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hba_lines = tokenize_file(file);
|
|
||||||
FreeFile(file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hba_lines = tokenize_file(file);
|
||||||
|
FreeFile(file);
|
||||||
pfree(conf_file);
|
pfree(conf_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user