Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
leak --
authorAugustin Degomme <augustin.degomme@imag.fr>
Thu, 4 Sep 2014 16:38:33 +0000 (18:38 +0200)
committerAugustin Degomme <augustin.degomme@imag.fr>
Thu, 11 Sep 2014 12:24:48 +0000 (14:24 +0200)
src/smpi/colls/allreduce-mvapich-rs.c

index 352fd25..ba3fa49 100644 (file)
@@ -34,7 +34,7 @@
     int mask, dst, is_commutative, pof2, newrank = 0, rem, newdst, i,
         send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
     MPI_Aint true_lb, true_extent, extent;
-    void *tmp_buf;
+    void *tmp_buf, *tmp_buf_free;
 
     if (count == 0) {
         return MPI_SUCCESS;
     smpi_datatype_extent(datatype, &true_lb, &true_extent);
     extent = smpi_datatype_get_extent(datatype);
 
-    tmp_buf= xbt_malloc(count * (MAX(extent, true_extent)));
+    tmp_buf_free= xbt_malloc(count * (MAX(extent, true_extent)));
 
     /* adjust for potential negative lower bound in datatype */
-    tmp_buf = (void *) ((char *) tmp_buf - true_lb);
+    tmp_buf = (void *) ((char *) tmp_buf_free - true_lb);
 
     /* copy local data into recvbuf */
     if (sendbuf != MPI_IN_PLACE) {
                                   MPI_STATUS_IGNORE);
         }
     }
-
+    xbt_free(tmp_buf_free);
     return (mpi_errno);
 
 }