Fix dereference of NULL variable (Coverty 473).
This commit was SVN r19201.
Этот коммит содержится в:
родитель
5eb4ebe8fa
Коммит
fb02c23389
@ -102,40 +102,39 @@ ompi_group_t *ompi_group_allocate_sporadic(int group_size)
|
||||
|
||||
/* create new group group element */
|
||||
new_group = OBJ_NEW(ompi_group_t);
|
||||
if (new_group) {
|
||||
if (OMPI_ERROR == new_group->grp_f_to_c_index) {
|
||||
OBJ_RELEASE(new_group);
|
||||
if( NULL == new_group) {
|
||||
goto error_exit;
|
||||
}
|
||||
if (OMPI_ERROR == new_group->grp_f_to_c_index) {
|
||||
OBJ_RELEASE(new_group);
|
||||
new_group = NULL;
|
||||
goto error_exit;
|
||||
}
|
||||
/* allocate array of (grp_sporadic_list )'s */
|
||||
if (0 < group_size) {
|
||||
new_group->sparse_data.grp_sporadic.grp_sporadic_list =
|
||||
(struct ompi_group_sporadic_list_t *)malloc
|
||||
(sizeof(struct ompi_group_sporadic_list_t ) * group_size);
|
||||
|
||||
/* non-empty group */
|
||||
if ( NULL == new_group->sparse_data.grp_sporadic.grp_sporadic_list) {
|
||||
/* sporadic list allocation failed */
|
||||
OBJ_RELEASE (new_group);
|
||||
new_group = NULL;
|
||||
goto error_exit;
|
||||
} else {
|
||||
/* allocate array of (grp_sporadic_list )'s */
|
||||
if (0 < group_size) {
|
||||
new_group->sparse_data.grp_sporadic.grp_sporadic_list =
|
||||
(struct ompi_group_sporadic_list_t *)malloc
|
||||
(sizeof(struct ompi_group_sporadic_list_t ) * group_size);
|
||||
|
||||
/* non-empty group */
|
||||
if ( NULL == new_group->sparse_data.grp_sporadic.grp_sporadic_list) {
|
||||
/* sporadic list allocation failed */
|
||||
OBJ_RELEASE (new_group);
|
||||
new_group = NULL;
|
||||
goto error_exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* set the group size */
|
||||
new_group->grp_proc_count = group_size; /* actually it's the number of
|
||||
elements in the sporadic list*/
|
||||
|
||||
/* initialize our rank to MPI_UNDEFINED */
|
||||
new_group->grp_my_rank = MPI_UNDEFINED;
|
||||
goto error_exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* set the group size */
|
||||
new_group->grp_proc_count = group_size; /* actually it's the number of
|
||||
elements in the sporadic list*/
|
||||
|
||||
/* initialize our rank to MPI_UNDEFINED */
|
||||
new_group->grp_my_rank = MPI_UNDEFINED;
|
||||
new_group->grp_proc_pointers = NULL;
|
||||
OMPI_GROUP_SET_SPORADIC(new_group);
|
||||
|
||||
error_exit:
|
||||
/* return */
|
||||
return new_group;
|
||||
}
|
||||
ompi_group_t *ompi_group_allocate_strided(void) {
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user