X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2f17e329e19084133ea3fae7f06054b976f5c383..c94e821e152ba209559e8b646a70c4a77849f13e:/src/smpi/smpi_base.c diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 6ffe7f6484..f5a219247d 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -197,7 +197,7 @@ static MPI_Request build_request(void *buf, int count, if(datatype->has_subtype == 1){ // This part handles the problem of non-contiguous memory old_buf = buf; - buf = xbt_malloc(count*smpi_datatype_size(datatype)); + buf = count==0 ? NULL : xbt_malloc(count*smpi_datatype_size(datatype)); if (flags & SEND) { subtype->serialize(old_buf, buf, count, datatype->substruct); }