From 03a4898a4d3dc700694a1dd1517848c14ec17214 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 19 Mar 2004 14:25:08 +0000 Subject: [PATCH] Really correct the group create logic this time. Really. This commit was SVN r937. --- src/group/mpi_group_init.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/group/mpi_group_init.c b/src/group/mpi_group_init.c index 49267ee41f..55c8a1d737 100644 --- a/src/group/mpi_group_init.c +++ b/src/group/mpi_group_init.c @@ -58,26 +58,26 @@ lam_group_t *lam_group_allocate(int group_size) /* create new group group element */ new_group=OBJ_NEW(lam_group_t); if( new_group ) { - /* allocate array of (lam_proc_t *)'s, one for each - * process in the group */ - new_group->grp_proc_pointers= - malloc(sizeof(lam_proc_t *)*group_size); - if( 0 < group_size ) { - /* non-empty group */ - if( !new_group->grp_proc_pointers ) { - /* grp_proc_pointers allocation failed */ - free(new_group); - new_group=NULL; + if( LAM_ERROR == new_group->grp_f_to_c_index){ + OBJ_RELEASE(new_group); + new_group=NULL; + } else { + /* allocate array of (lam_proc_t *)'s, one for each + * process in the group */ + new_group->grp_proc_pointers= + malloc(sizeof(lam_proc_t *)*group_size); + if( 0 < group_size ) { + /* non-empty group */ + if( !new_group->grp_proc_pointers ) { + /* grp_proc_pointers allocation failed */ + free(new_group); + new_group=NULL; + } } + + /* set the group size */ + new_group->grp_proc_count=group_size; } - - /* set the group size */ - new_group->grp_proc_count=group_size; - } - - if( LAM_ERROR == new_group->grp_f_to_c_index){ - OBJ_RELEASE(new_group); - new_group=NULL; } /* return */