From: Stéphane Castelli Date: Tue, 25 Mar 2014 15:57:08 +0000 (+0100) Subject: small leak (removed) X-Git-Tag: v3_11~105^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/05e606bc7ac2a616e8f741e382d3802898069e2f small leak (removed) --- diff --git a/src/smpi/smpi_topo.c b/src/smpi/smpi_topo.c index 7429959fa2..56622b867e 100644 --- a/src/smpi/smpi_topo.c +++ b/src/smpi/smpi_topo.c @@ -53,10 +53,11 @@ int smpi_mpi_cart_create(MPI_Comm comm_old, int ndims, int dims[], rank = smpi_comm_rank(comm_old); - // TODO : add somewhere : if topo != NULL, free... - topo = smpi_topo_create(ndims); + + newSize = 1; if(ndims != 0) { + topo = smpi_topo_create(ndims); for (i = 0 ; i < ndims ; i++) { newSize *= dims[i]; } @@ -91,6 +92,7 @@ int smpi_mpi_cart_create(MPI_Comm comm_old, int ndims, int dims[], } else { if (rank == 0) { + topo = smpi_topo_create(ndims); *comm_cart = smpi_comm_new(smpi_comm_group(MPI_COMM_SELF), topo); } else {