File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 88 *
99 *
1010 * 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 $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
3636#ifdef CYR_RECODE
3737unsigned char RecodeForwTable [128 ];
3838unsigned char RecodeBackTable [128 ];
39-
4039#endif
4140
4241ProcessingMode Mode = InitProcessing ;
@@ -82,7 +81,11 @@ IgnoreSystemIndexes(bool mode)
8281void
8382SetDatabasePath (const char * path )
8483{
85- free (DatabasePath );
84+ if (DatabasePath )
85+ {
86+ free (DatabasePath );
87+ DatabasePath = NULL ;
88+ }
8689 /* use strdup since this is done before memory contexts are set up */
8790 if (path )
8891 {
@@ -94,7 +97,12 @@ SetDatabasePath(const char *path)
9497void
9598SetDatabaseName (const char * name )
9699{
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 */
98106 if (name )
99107 {
100108 DatabaseName = strdup (name );
@@ -112,8 +120,6 @@ SetDataDir(const char *dir)
112120 char * new ;
113121
114122 AssertArg (dir );
115- if (DataDir )
116- free (DataDir );
117123
118124 if (dir [0 ] != '/' )
119125 {
@@ -155,6 +161,8 @@ SetDataDir(const char *dir)
155161 elog (FATAL , "out of memory" );
156162 }
157163
164+ if (DataDir )
165+ free (DataDir );
158166 DataDir = new ;
159167}
160168
You can’t perform that action at this time.
0 commit comments