Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 03a7cd1

Browse files
committed
Fix for memory leak.
1 parent 39740d7 commit 03a7cd1

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/backend/utils/init/miscinit.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.12 1998/02/26 04:38:06 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.13 1998/04/05 05:51:58 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -229,20 +229,20 @@ GetProcessingMode()
229229
* Returns path to database.
230230
*
231231
*/
232-
char *
232+
const char *
233233
GetDatabasePath()
234234
{
235-
return strdup(DatabasePath);
235+
return DatabasePath;
236236
}
237237

238238
/*
239239
* GetDatabaseName --
240240
* Returns name of database.
241241
*/
242-
char *
242+
const char *
243243
GetDatabaseName()
244244
{
245-
return strdup(DatabaseName);
245+
return DatabaseName;
246246
}
247247

248248
void

src/backend/utils/init/postinit.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.25 1998/02/26 04:38:12 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.26 1998/04/05 05:52:00 momjian Exp $
1111
*
1212
* NOTES
1313
* InitPostgres() is the function called from PostgresMain
@@ -195,8 +195,8 @@ VerifySystemDatabase()
195195
static void
196196
VerifyMyDatabase()
197197
{
198-
char *name;
199-
char *myPath;
198+
const char *name;
199+
const char *myPath;
200200

201201
/* Failure reason returned by some function. NULL if no failure */
202202
char *reason;

src/include/miscadmin.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $Id: miscadmin.h,v 1.20 1998/02/26 04:39:48 momjian Exp $
14+
* $Id: miscadmin.h,v 1.21 1998/04/05 05:52:10 momjian Exp $
1515
*
1616
* NOTES
1717
* some of the information in this file will be moved to
@@ -116,8 +116,8 @@ extern int GetDatabaseInfo(char *name, Oid *owner, char *path);
116116
extern char *ExpandDatabasePath(char *path);
117117

118118
/* now in utils/init/miscinit.c */
119-
extern char *GetDatabasePath(void);
120-
extern char *GetDatabaseName(void);
119+
extern const char *GetDatabasePath(void);
120+
extern const char *GetDatabaseName(void);
121121
extern void SetDatabaseName(char *name);
122122
extern void SetDatabasePath(char *path);
123123
extern char *getpgusername(void);

0 commit comments

Comments
 (0)