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 9ce1c2e640
commit 0a7c7ae7ab

View File

@@ -5481,6 +5481,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)
{
@@ -5504,6 +5505,7 @@ check_source_server()
else
{
PQfinish(cell->node_info->conn);
cell->node_info->conn = NULL;
}
}
clear_node_info_list(&all_nodes);