From 02245a0014af9302d509665cb788809ff05814bb 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 fbb680b0..bd4496e7 100644 --- a/repmgrd-physical.c +++ b/repmgrd-physical.c @@ -4478,10 +4478,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,