From 0563a90f139002a64d30ca7a3d5e2ed8fd0f547b Mon Sep 17 00:00:00 2001 From: Moe Jette <jette1@llnl.gov> Date: Thu, 6 Apr 2006 23:02:34 +0000 Subject: [PATCH] Remove extra malloc and error check from xmalloc (it will just fail rather than return an error code). --- src/common/dist_tasks.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/common/dist_tasks.c b/src/common/dist_tasks.c index e5071b7c98f..02bbdc98ca2 100644 --- a/src/common/dist_tasks.c +++ b/src/common/dist_tasks.c @@ -257,11 +257,8 @@ extern int task_layout(slurm_step_layout_t *step_layout) * step_layout->num_hosts); step_layout->host = xmalloc(sizeof(char *) * step_layout->num_hosts); - if ((step_layout->cpus == NULL) || (step_layout->tasks == NULL) || - (step_layout->host == NULL)) { - slurm_seterrno(ENOMEM); - return SLURM_ERROR; - } + step_layout->tids = xmalloc(sizeof(uint32_t *) + * step_layout->num_hosts); for (i=0; i<step_layout->num_hosts; i++) { step_layout->host[i] = hostlist_shift(step_layout->hl); @@ -272,14 +269,6 @@ extern int task_layout(slurm_step_layout_t *step_layout) cpu_cnt = 0; } } - step_layout->tasks = xmalloc(sizeof(uint32_t) - * step_layout->num_hosts); - step_layout->tids = xmalloc(sizeof(uint32_t *) - * step_layout->num_hosts); - if ((step_layout->tasks == NULL) || (step_layout->tids == NULL)) { - slurm_seterrno(ENOMEM); - return SLURM_ERROR; - } if (step_layout->task_dist == SLURM_DIST_CYCLIC) return _task_layout_cyclic(step_layout); -- GitLab