diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/commands/dbcommands.c | 13 | ||||
-rw-r--r-- | src/backend/utils/init/postinit.c | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 1bbecfeddf6..9d0f83cde31 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -217,6 +217,8 @@ CreateDatabaseUsingWalLog(Oid src_dboid, Oid dst_dboid, UnlockRelationId(&dstrelid, AccessShareLock); } + pfree(srcpath); + pfree(dstpath); list_free_deep(rnodelist); } @@ -628,6 +630,8 @@ CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid, Oid src_tsid, (void) XLogInsert(RM_DBASE_ID, XLOG_DBASE_CREATE_FILE_COPY | XLR_SPECIAL_REL_UPDATE); } + pfree(srcpath); + pfree(dstpath); } table_endscan(scan); table_close(rel, AccessShareLock); @@ -2128,6 +2132,9 @@ movedb(const char *dbname, const char *tblspcname) /* Now it's safe to release the database lock */ UnlockSharedObjectForSession(DatabaseRelationId, db_id, 0, AccessExclusiveLock); + + pfree(src_dbpath); + pfree(dst_dbpath); } /* Error cleanup callback for movedb */ @@ -2141,6 +2148,8 @@ movedb_failure_callback(int code, Datum arg) dstpath = GetDatabasePath(fparms->dest_dboid, fparms->dest_tsoid); (void) rmtree(dstpath, true); + + pfree(dstpath); } /* @@ -3051,6 +3060,9 @@ dbase_redo(XLogReaderState *record) * We don't need to copy subdirectories */ copydir(src_path, dst_path, false); + + pfree(src_path); + pfree(dst_path); } else if (info == XLOG_DBASE_CREATE_WAL_LOG) { @@ -3063,6 +3075,7 @@ dbase_redo(XLogReaderState *record) /* Create the database directory with the version file. */ CreateDirAndVersionFile(dbpath, xlrec->db_id, xlrec->tablespace_id, true); + pfree(dbpath); } else if (info == XLOG_DBASE_DROP) { diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 5dbc7379e36..38e5b54a15a 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -1057,6 +1057,7 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username, } SetDatabasePath(fullpath); + pfree(fullpath); /* * It's now possible to do real access to the system catalogs. |