mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +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)
|
||||
{
|
||||
PQfinish(primaryConn);
|
||||
primaryConn = NULL;
|
||||
|
||||
if (local_options.failover == MANUAL_FAILOVER)
|
||||
{
|
||||
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 (PQstatus(nodeConn) != CONNECTION_OK)
|
||||
{
|
||||
if (nodeConn != NULL)
|
||||
PQfinish(nodeConn);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
visible_nodes++;
|
||||
nodes[i].is_visible = true;
|
||||
@@ -1274,6 +1282,11 @@ terminate(int retval)
|
||||
unlink(pid_file);
|
||||
}
|
||||
|
||||
if (progname)
|
||||
{
|
||||
free(progname);
|
||||
}
|
||||
|
||||
log_info("Terminating...\n");
|
||||
|
||||
exit(retval);
|
||||
|
||||
Reference in New Issue
Block a user