pg_upgrade: fix one-byte per empty db memory leak
Report by Tatsuo Ishii, Coverity
This commit is contained in:
parent
c4fda14845
commit
ac7009abd2
@ -110,10 +110,8 @@ transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr,
|
|||||||
pg_fatal("old database \"%s\" not found in the new cluster\n",
|
pg_fatal("old database \"%s\" not found in the new cluster\n",
|
||||||
old_db->db_name);
|
old_db->db_name);
|
||||||
|
|
||||||
n_maps = 0;
|
|
||||||
mappings = gen_db_file_maps(old_db, new_db, &n_maps, old_pgdata,
|
mappings = gen_db_file_maps(old_db, new_db, &n_maps, old_pgdata,
|
||||||
new_pgdata);
|
new_pgdata);
|
||||||
|
|
||||||
if (n_maps)
|
if (n_maps)
|
||||||
{
|
{
|
||||||
print_maps(mappings, n_maps, new_db->db_name);
|
print_maps(mappings, n_maps, new_db->db_name);
|
||||||
@ -123,9 +121,9 @@ transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr,
|
|||||||
#endif
|
#endif
|
||||||
transfer_single_new_db(pageConverter, mappings, n_maps,
|
transfer_single_new_db(pageConverter, mappings, n_maps,
|
||||||
old_tablespace);
|
old_tablespace);
|
||||||
|
|
||||||
pg_free(mappings);
|
|
||||||
}
|
}
|
||||||
|
/* We allocate something even for n_maps == 0 */
|
||||||
|
pg_free(mappings);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user