Commit 497e65f8 authored by Bruce Momjian's avatar Bruce Momjian

In pg_upgrade, no need to initialize global struct values; they are

always zeros.  Also no need to free memory before we exit.
parent bca8b7f1
......@@ -22,12 +22,6 @@ static void free_rel_infos(RelInfoArr *rel_arr);
static void print_db_infos(DbInfoArr *dbinfo);
static void print_rel_infos(RelInfoArr *arr);
void
initialize_cluster_info(ClusterInfo *cluster)
{
cluster->dbarr.ndbs = 0;
cluster->dbarr.dbs = NULL;
}
/*
* gen_db_file_maps()
......
......@@ -63,9 +63,6 @@ main(int argc, char **argv)
char *deletion_script_file_name = NULL;
bool live_check = false;
initialize_cluster_info(&old_cluster);
initialize_cluster_info(&new_cluster);
parseCommandLine(argc, argv);
output_check_banner(&live_check);
......@@ -428,31 +425,10 @@ set_frozenxids(void)
static void
cleanup(void)
{
int tblnum;
char filename[MAXPGPATH];
for (tblnum = 0; tblnum < os_info.num_tablespaces; tblnum++)
pg_free(os_info.tablespaces[tblnum]);
pg_free(os_info.tablespaces);
free_db_and_rel_infos(&old_cluster.dbarr);
free_db_and_rel_infos(&new_cluster.dbarr);
pg_free(log_opts.filename);
pg_free(os_info.user);
pg_free(old_cluster.controldata.lc_collate);
pg_free(new_cluster.controldata.lc_collate);
pg_free(old_cluster.controldata.lc_ctype);
pg_free(new_cluster.controldata.lc_ctype);
pg_free(old_cluster.controldata.encoding);
pg_free(new_cluster.controldata.encoding);
pg_free(old_cluster.tablespace_suffix);
pg_free(new_cluster.tablespace_suffix);
if (log_opts.fd != NULL)
{
if (log_opts.fd)
fclose(log_opts.fd);
log_opts.fd = NULL;
}
if (log_opts.debug_fd)
fclose(log_opts.debug_fd);
......
......@@ -326,7 +326,6 @@ void check_loadable_libraries(void);
/* info.c */
void initialize_cluster_info(ClusterInfo *cluster);
FileNameMap *gen_db_file_maps(DbInfo *old_db,
DbInfo *new_db, int *nmaps, const char *old_pgdata,
const char *new_pgdata);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment