Skip to content

Commit 80185f4

Browse files
committed
Seems like a bad idea to free() a string we are about to use in an
error message.
1 parent 2467934 commit 80185f4

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/backend/utils/init/miscinit.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.74 2001/08/06 13:45:15 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.75 2001/08/06 18:17:42 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -168,16 +168,12 @@ SetDataDir(const char *dir)
168168
* Check if the directory has group or world access. If so, reject.
169169
*/
170170
if (stat(new, &stat_buf) == -1)
171-
{
172-
free(new);
173-
elog(FATAL, "could not read permissions of directory %s: %s", new, strerror(errno));
174-
}
171+
elog(FATAL, "could not read permissions of directory %s: %s",
172+
new, strerror(errno));
175173

176174
if (stat_buf.st_mode & (S_IRWXG | S_IRWXO))
177-
{
178-
free(new);
179-
elog(FATAL, "data directory %s has group or world access; permissions should be u=rwx (0700)", new);
180-
}
175+
elog(FATAL, "data directory %s has group or world access; permissions should be u=rwx (0700)",
176+
new);
181177

182178
if (DataDir)
183179
free(DataDir);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy