Seems like a bad idea to free() a string we are about to use in an

error message.
This commit is contained in:
Tom Lane 2001-08-06 18:17:42 +00:00
parent 246793469e
commit 80185f4b5b

View 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);