]> granicus.if.org Git - postgresql/commitdiff
The actual segfault was caused by a double pfree(), but ISTM that
authorBruce Momjian <bruce@momjian.us>
Sat, 14 Dec 2002 18:49:43 +0000 (18:49 +0000)
committerBruce Momjian <bruce@momjian.us>
Sat, 14 Dec 2002 18:49:43 +0000 (18:49 +0000)
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

src/backend/libpq/hba.c

index 67da2f78adfbe2f4dd0fedd363a7e7b110d81d27..ea04cfc2bd933f55bf5252991e8134a514230b93 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * 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");
        if (file == NULL)
        {
-               /* The open of the config file failed.  */
-               elog(LOG, "load_hba: Unable to open authentication config file \"%s\": %m",
+               elog(FATAL,
+                        "load_hba: Unable to open authentication config file \"%s\": %m",
                         conf_file);
-               pfree(conf_file);
-       }
-       else
-       {
-               hba_lines = tokenize_file(file);
-               FreeFile(file);
        }
+
+       hba_lines = tokenize_file(file);
+       FreeFile(file);
        pfree(conf_file);
 }