standby clone: explicitly set closed connection pointers to NULL

We omitted to do this with the connections used when checking the system
identifier, which means libpq calls by the teardown function using the
pointer risk using unallocated memory.

Addresses issue reported in GitHub #644.
This commit is contained in:
Ian Barwick
2020-05-11 13:52:10 +09:00
parent 389c0ab9c0
commit 1b5ad743b5

View File

@@ -5627,6 +5627,7 @@ check_source_server()
{
uint64 test_system_identifier = system_identifier(cell->node_info->conn);
PQfinish(cell->node_info->conn);
cell->node_info->conn = NULL;
if (test_system_identifier != UNKNOWN_SYSTEM_IDENTIFIER)
{
@@ -5650,6 +5651,7 @@ check_source_server()
else
{
PQfinish(cell->node_info->conn);
cell->node_info->conn = NULL;
}
}
clear_node_info_list(&all_nodes);