Seems like a bad idea to free() a string we are about to use in an
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 6 Aug 2001 18:17:42 +0000 (18:17 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 6 Aug 2001 18:17:42 +0000 (18:17 +0000)
error message.

src/backend/utils/init/miscinit.c

index 99fc6824c609b6b25d8d2c805f36764bea7d22cb..86b46106cd37fa66c75e39a3f3e4c473cd115b68 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.74 2001/08/06 13:45:15 petere Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.75 2001/08/06 18:17:42 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -168,16 +168,12 @@ SetDataDir(const char *dir)
         * Check if the directory has group or world access.  If so, reject.
         */
        if (stat(new, &stat_buf) == -1)
-       {
-               free(new);
-               elog(FATAL, "could not read permissions of directory %s: %s", new, strerror(errno));
-       }
+               elog(FATAL, "could not read permissions of directory %s: %s",
+                        new, strerror(errno));
 
        if (stat_buf.st_mode & (S_IRWXG | S_IRWXO))
-       {
-               free(new);
-               elog(FATAL, "data directory %s has group or world access; permissions should be u=rwx (0700)", new);
-       }
+               elog(FATAL, "data directory %s has group or world access; permissions should be u=rwx (0700)",
+                        new);
 
        if (DataDir)
                free(DataDir);