mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-24 23:56:29 +00:00
Remove redundant struct allocation
This commit is contained in:
@@ -354,18 +354,9 @@ _do_repmgr_pause(bool pause)
|
|||||||
PGconn *conn = NULL;
|
PGconn *conn = NULL;
|
||||||
NodeInfoList nodes = T_NODE_INFO_LIST_INITIALIZER;
|
NodeInfoList nodes = T_NODE_INFO_LIST_INITIALIZER;
|
||||||
NodeInfoListCell *cell = NULL;
|
NodeInfoListCell *cell = NULL;
|
||||||
RepmgrdInfo **repmgrd_info;
|
|
||||||
int i;
|
int i;
|
||||||
int error_nodes = 0;
|
int error_nodes = 0;
|
||||||
|
|
||||||
repmgrd_info = (RepmgrdInfo **) pg_malloc0(sizeof(RepmgrdInfo *) * nodes.node_count);
|
|
||||||
|
|
||||||
if (repmgrd_info == NULL)
|
|
||||||
{
|
|
||||||
log_error(_("unable to allocate memory"));
|
|
||||||
exit(ERR_OUT_OF_MEMORY);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Connect to local database to obtain cluster connection data */
|
/* Connect to local database to obtain cluster connection data */
|
||||||
log_verbose(LOG_INFO, _("connecting to database"));
|
log_verbose(LOG_INFO, _("connecting to database"));
|
||||||
|
|
||||||
@@ -380,9 +371,6 @@ _do_repmgr_pause(bool pause)
|
|||||||
|
|
||||||
for (cell = nodes.head; cell; cell = cell->next)
|
for (cell = nodes.head; cell; cell = cell->next)
|
||||||
{
|
{
|
||||||
repmgrd_info[i] = pg_malloc0(sizeof(RepmgrdInfo));
|
|
||||||
repmgrd_info[i]->node_id = cell->node_info->node_id;
|
|
||||||
|
|
||||||
log_verbose(LOG_DEBUG, "pausing node %i (%s)",
|
log_verbose(LOG_DEBUG, "pausing node %i (%s)",
|
||||||
cell->node_info->node_id,
|
cell->node_info->node_id,
|
||||||
cell->node_info->node_name);
|
cell->node_info->node_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user