repmgrd: move connection pointer declaration inside relevant block

As it's used only there and nowhere else.
This commit is contained in:
Ian Barwick
2022-01-04 12:45:28 +09:00
parent 5de74d9e18
commit b8cb1feb49

View File

@@ -3067,7 +3067,6 @@ do_primary_failover(void)
t_node_info new_primary = T_NODE_INFO_INITIALIZER;
RecordStatus record_status = RECORD_NOT_FOUND;
PGconn *new_primary_conn;
record_status = get_node_record(local_conn, new_primary_id, &new_primary);
@@ -3079,6 +3078,7 @@ do_primary_failover(void)
else
{
PQExpBufferData event_details;
PGconn *new_primary_conn;
initPQExpBuffer(&event_details);
appendPQExpBuffer(&event_details,
@@ -3099,7 +3099,6 @@ do_primary_failover(void)
event_details.data);
close_connection(&new_primary_conn);
termPQExpBuffer(&event_details);
}
failover_state = FAILOVER_STATE_REQUIRES_MANUAL_FAILOVER;
}