mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
fix: fixed some leaks
This commit is contained in:
13
repmgrd.c
13
repmgrd.c
@@ -553,6 +553,9 @@ StandbyMonitor(void)
|
|||||||
|
|
||||||
if (PQstatus(primaryConn) != CONNECTION_OK)
|
if (PQstatus(primaryConn) != CONNECTION_OK)
|
||||||
{
|
{
|
||||||
|
PQfinish(primaryConn);
|
||||||
|
primaryConn = NULL;
|
||||||
|
|
||||||
if (local_options.failover == MANUAL_FAILOVER)
|
if (local_options.failover == MANUAL_FAILOVER)
|
||||||
{
|
{
|
||||||
log_err(_("We couldn't reconnect to master. Now checking if another node has been promoted.\n"));
|
log_err(_("We couldn't reconnect to master. Now checking if another node has been promoted.\n"));
|
||||||
@@ -774,7 +777,12 @@ do_failover(void)
|
|||||||
|
|
||||||
/* if we can't see the node just skip it */
|
/* if we can't see the node just skip it */
|
||||||
if (PQstatus(nodeConn) != CONNECTION_OK)
|
if (PQstatus(nodeConn) != CONNECTION_OK)
|
||||||
|
{
|
||||||
|
if (nodeConn != NULL)
|
||||||
|
PQfinish(nodeConn);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
visible_nodes++;
|
visible_nodes++;
|
||||||
nodes[i].is_visible = true;
|
nodes[i].is_visible = true;
|
||||||
@@ -1274,6 +1282,11 @@ terminate(int retval)
|
|||||||
unlink(pid_file);
|
unlink(pid_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (progname)
|
||||||
|
{
|
||||||
|
free(progname);
|
||||||
|
}
|
||||||
|
|
||||||
log_info("Terminating...\n");
|
log_info("Terminating...\n");
|
||||||
|
|
||||||
exit(retval);
|
exit(retval);
|
||||||
|
|||||||
Reference in New Issue
Block a user