mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user