mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 15:16:29 +00:00
fix: sscanf() does not set variables to 0 on error
This commit is contained in:
@@ -848,6 +848,9 @@ do_failover(void)
|
||||
terminate(ERR_FAILOVER_FAIL);
|
||||
}
|
||||
|
||||
uxlogid = 0;
|
||||
uxrecoff = 0;
|
||||
|
||||
sqlquery_snprintf(sqlquery, "SELECT pg_last_xlog_receive_location()");
|
||||
res = PQexec(nodeConn, sqlquery);
|
||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||
@@ -934,6 +937,9 @@ do_failover(void)
|
||||
break;
|
||||
}
|
||||
|
||||
uxlogid = 0;
|
||||
uxrecoff = 0;
|
||||
|
||||
sqlquery_snprintf(sqlquery, "SELECT %s.repmgr_get_last_standby_location()", repmgr_schema);
|
||||
res = PQexec(nodeConn, sqlquery);
|
||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||
|
||||
Reference in New Issue
Block a user