*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.69 2001/06/06 17:07:46 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.70 2001/06/13 19:52:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifdef CYR_RECODE
unsigned char RecodeForwTable[128];
unsigned char RecodeBackTable[128];
-
#endif
ProcessingMode Mode = InitProcessing;
void
SetDatabasePath(const char *path)
{
- free(DatabasePath);
+ if (DatabasePath)
+ {
+ free(DatabasePath);
+ DatabasePath = NULL;
+ }
/* use strdup since this is done before memory contexts are set up */
if (path)
{
void
SetDatabaseName(const char *name)
{
- free(DatabaseName);
+ if (DatabaseName)
+ {
+ free(DatabaseName);
+ DatabaseName = NULL;
+ }
+ /* use strdup since this is done before memory contexts are set up */
if (name)
{
DatabaseName = strdup(name);
char *new;
AssertArg(dir);
- if (DataDir)
- free(DataDir);
if (dir[0] != '/')
{
elog(FATAL, "out of memory");
}
+ if (DataDir)
+ free(DataDir);
DataDir = new;
}