From: degomme Date: Thu, 28 Apr 2016 14:59:18 +0000 (+0200) Subject: Avoid allocating 0 bytes (issue with mallocators only?) X-Git-Tag: v3_14~1311 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/911fe67a4769690da6e71d578e3bf358a6285076 Avoid allocating 0 bytes (issue with mallocators only?) --- diff --git a/src/smpi/smpi_pmpi.cpp b/src/smpi/smpi_pmpi.cpp index 5a3cd2adcc..abc914ce4a 100644 --- a/src/smpi/smpi_pmpi.cpp +++ b/src/smpi/smpi_pmpi.cpp @@ -1494,11 +1494,14 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta smpi_bench_end(); //save requests information for tracing int i; - int *srcs = xbt_new0(int, count); - int *dsts = xbt_new0(int, count); - int *recvs = xbt_new0(int, count); - MPI_Comm *comms = xbt_new0(MPI_Comm, count); - + int *srcs = NULL, *dsts = NULL, *recvs = NULL; + MPI_Comm* comms = NULL; + if(count>0){ + srcs = xbt_new0(int, count); + dsts = xbt_new0(int, count); + recvs = xbt_new0(int, count); + comms = xbt_new0(MPI_Comm, count); + } for (i = 0; i < count; i++) { MPI_Request req = requests[i]; //already received requests are no longer valid if (req) {