File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change 13
13
*
14
14
*
15
15
* IDENTIFICATION
16
- * $PostgreSQL: pgsql/src/backend/main/main.c,v 1.94 2004/12/31 21:59:53 pgsql Exp $
16
+ * $PostgreSQL: pgsql/src/backend/main/main.c,v 1.95 2005/10/13 15:37:14 momjian Exp $
17
17
*
18
18
*-------------------------------------------------------------------------
19
19
*/
50
50
int
51
51
main (int argc , char * argv [])
52
52
{
53
- int len ;
54
-
55
53
#ifndef WIN32
56
54
struct passwd * pw ;
57
55
#endif
@@ -256,13 +254,7 @@ main(int argc, char *argv[])
256
254
* (and possibly first argument) we were called with. The lack of
257
255
* consistency here is historical.
258
256
*/
259
- len = strlen (argv [0 ]);
260
-
261
- if ((len >= 10 && strcmp (argv [0 ] + len - 10 , "postmaster" ) == 0 )
262
- #ifdef WIN32
263
- || (len >= 14 && strcmp (argv [0 ] + len - 14 , "postmaster.exe" ) == 0 )
264
- #endif
265
- )
257
+ if (strcmp (get_progname (argv [0 ]), "postmaster" ) == 0 )
266
258
{
267
259
/* Called as "postmaster" */
268
260
exit (PostmasterMain (argc , argv ));
Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/port/path.c,v 1.59 2005/09/27 17:39:35 tgl Exp $
11
+ * $PostgreSQL: pgsql/src/port/path.c,v 1.60 2005/10/13 15:37:14 momjian Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -403,7 +403,7 @@ get_progname(const char *argv0)
403
403
{
404
404
char * progname ;
405
405
406
- progname = strdup (nodir_name );
406
+ progname = strdup (nodir_name ); /* leaks memory, but called only once */
407
407
if (progname == NULL )
408
408
{
409
409
fprintf (stderr , "%s: out of memory\n" , nodir_name );
You can’t perform that action at this time.
0 commit comments