From 356f65531f269cdbf4389d508c705094fdafc44c Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 4 Jan 2022 12:45:28 +0900 Subject: [PATCH] repmgrd: move connection pointer declaration inside relevant block As it's used only there and nowhere else. --- repmgrd-physical.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/repmgrd-physical.c b/repmgrd-physical.c index 9e6a9d48..9a2624d4 100644 --- a/repmgrd-physical.c +++ b/repmgrd-physical.c @@ -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; }