File tree 1 file changed +14
-6
lines changed
1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.69 2001/06/06 17:07:46 tgl Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.70 2001/06/13 19:52:33 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
36
36
#ifdef CYR_RECODE
37
37
unsigned char RecodeForwTable [128 ];
38
38
unsigned char RecodeBackTable [128 ];
39
-
40
39
#endif
41
40
42
41
ProcessingMode Mode = InitProcessing ;
@@ -82,7 +81,11 @@ IgnoreSystemIndexes(bool mode)
82
81
void
83
82
SetDatabasePath (const char * path )
84
83
{
85
- free (DatabasePath );
84
+ if (DatabasePath )
85
+ {
86
+ free (DatabasePath );
87
+ DatabasePath = NULL ;
88
+ }
86
89
/* use strdup since this is done before memory contexts are set up */
87
90
if (path )
88
91
{
@@ -94,7 +97,12 @@ SetDatabasePath(const char *path)
94
97
void
95
98
SetDatabaseName (const char * name )
96
99
{
97
- free (DatabaseName );
100
+ if (DatabaseName )
101
+ {
102
+ free (DatabaseName );
103
+ DatabaseName = NULL ;
104
+ }
105
+ /* use strdup since this is done before memory contexts are set up */
98
106
if (name )
99
107
{
100
108
DatabaseName = strdup (name );
@@ -112,8 +120,6 @@ SetDataDir(const char *dir)
112
120
char * new ;
113
121
114
122
AssertArg (dir );
115
- if (DataDir )
116
- free (DataDir );
117
123
118
124
if (dir [0 ] != '/' )
119
125
{
@@ -155,6 +161,8 @@ SetDataDir(const char *dir)
155
161
elog (FATAL , "out of memory" );
156
162
}
157
163
164
+ if (DataDir )
165
+ free (DataDir );
158
166
DataDir = new ;
159
167
}
160
168
You can’t perform that action at this time.
0 commit comments