repmgrd: always close the connection if the pointer is not NULL

This commit is contained in:
Ian Barwick
2018-04-25 14:08:17 +09:00
parent 3364f8bdf0
commit b553a70ad5

View File

@@ -317,10 +317,7 @@ close_connection(PGconn **conn)
if (*conn == NULL) if (*conn == NULL)
return; return;
if (PQstatus(*conn) == CONNECTION_OK) PQfinish(*conn);
{
PQfinish(*conn);
}
*conn = NULL; *conn = NULL;
} }