From 99923f5ffc137a13d6a03d377337f2c189c7e616 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 11 Mar 2019 19:06:07 +0900 Subject: [PATCH] Remove redundant struct allocation --- repmgr-action-daemon.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/repmgr-action-daemon.c b/repmgr-action-daemon.c index 99fc7935..fdbfbb66 100644 --- a/repmgr-action-daemon.c +++ b/repmgr-action-daemon.c @@ -354,18 +354,9 @@ _do_repmgr_pause(bool pause) PGconn *conn = NULL; NodeInfoList nodes = T_NODE_INFO_LIST_INITIALIZER; NodeInfoListCell *cell = NULL; - RepmgrdInfo **repmgrd_info; int i; 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 */ log_verbose(LOG_INFO, _("connecting to database")); @@ -380,9 +371,6 @@ _do_repmgr_pause(bool pause) 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)", cell->node_info->node_id, cell->node_info->node_name);