From e4c573a7f63dfd547c4886217f1080692e4cfca6 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 2 May 2019 18:50:21 +0900 Subject: [PATCH] repmgrd: add missing PQfinish() calls --- repmgrd-physical.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/repmgrd-physical.c b/repmgrd-physical.c index b8e662d0..f1382f58 100644 --- a/repmgrd-physical.c +++ b/repmgrd-physical.c @@ -3931,10 +3931,13 @@ check_connection(t_node_info *node_info, PGconn **conn) log_info(_("attempting to reconnect to node \"%s\" (ID: %i)"), node_info->node_name, node_info->node_id); + + PQfinish(*conn); *conn = establish_db_connection(node_info->conninfo, false); if (PQstatus(*conn) != CONNECTION_OK) { + PQfinish(*conn); *conn = NULL; log_warning(_("reconnection to node \"%s\" (ID: %i) failed"), node_info->node_name,