1
1
as reported by Coverity with CIDs 1041232, 1041234, 1041235
1269789 and 1269996
Этот коммит содержится в:
Gilles Gouaillardet 2015-03-09 15:22:22 +09:00
родитель a9044945fe
Коммит 9107bf5077
3 изменённых файлов: 19 добавлений и 14 удалений

Просмотреть файл

@ -14,7 +14,7 @@
* Copyright (c) 2012-2013 Inria. All rights reserved.
* Copyright (c) 2014 Los Alamos National Security, LLC. All right
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -91,7 +91,6 @@ int mca_topo_base_cart_create(mca_topo_base_module_t *topo,
cart = OBJ_NEW(mca_topo_base_comm_cart_2_2_0_t);
if( NULL == cart ) {
ompi_comm_free(&new_comm);
return OMPI_ERR_OUT_OF_RESOURCE;
}
cart->ndims = ndims;
@ -172,11 +171,13 @@ int mca_topo_base_cart_create(mca_topo_base_module_t *topo,
new_rank, num_procs, topo_procs);
if (OMPI_SUCCESS != ret) {
/* something wrong happened during setting the communicator */
new_comm->c_topo = NULL;
new_comm->c_flags &= ~OMPI_COMM_CART;
free(topo_procs);
OBJ_RELEASE(cart);
ompi_comm_free (&new_comm);
if (MPI_COMM_NULL != new_comm) {
new_comm->c_topo = NULL;
new_comm->c_flags &= ~OMPI_COMM_CART;
ompi_comm_free (&new_comm);
}
return ret;
}

Просмотреть файл

@ -8,7 +8,7 @@
* reserved.
* Copyright (c) 2011-2013 Inria. All rights reserved.
* Copyright (c) 2011-2013 Université Bordeaux 1
* Copyright (c) 2014 Research Organization for Information Science
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*/
@ -347,12 +347,14 @@ int mca_topo_base_dist_graph_create(mca_topo_base_module_t* module,
if ( NULL != topo->outw ) {
free(topo->outw);
}
if (MPI_COMM_NULL != new_comm) {
new_comm->c_topo->mtc.dist_graph = NULL;
new_comm->c_topo = NULL;
new_comm->c_flags &= ~OMPI_COMM_DIST_GRAPH;
ompi_comm_free (&new_comm);
}
free(topo);
free(topo_procs);
new_comm->c_topo = NULL;
new_comm->c_flags &= ~OMPI_COMM_DIST_GRAPH;
new_comm->c_topo->mtc.dist_graph = NULL;
ompi_comm_free (&new_comm);
return ret;
}
*newcomm = new_comm;

Просмотреть файл

@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2012-2013 Inria. All rights reserved.
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -131,11 +131,13 @@ int mca_topo_base_graph_create(mca_topo_base_module_t *topo,
ret = ompi_comm_enable(old_comm, new_comm,
new_rank, num_procs, topo_procs);
if (OMPI_SUCCESS != ret) {
new_comm->c_topo = NULL;
new_comm->c_flags &= ~OMPI_COMM_GRAPH;
free(topo_procs);
OBJ_RELEASE(graph);
ompi_comm_free (&new_comm);
if (MPI_COMM_NULL != new_comm) {
new_comm->c_topo = NULL;
new_comm->c_flags &= ~OMPI_COMM_GRAPH;
ompi_comm_free (&new_comm);
}
return ret;
}