Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Free memory.
[simgrid.git] / teshsuite / smpi / mpich3-test / pt2pt / dtype_send.c
index a089bd6..53e8033 100644 (file)
@@ -13,7 +13,7 @@
 int main(int argc, char **argv)
 {
     int i, rank, size;
-    MPI_Request *req;
+    MPI_Request *req=NULL;
     MPI_Datatype newtype;
     int snd_buf[3], rcv_buf[3];
     int count = 2;
@@ -52,6 +52,7 @@ int main(int argc, char **argv)
         MPI_Waitall(NUM_LOOPS, req, MPI_STATUSES_IGNORE);
 
     MPI_Barrier(MPI_COMM_WORLD);
+    free(req);
 
     /* test issends */
     MPI_Type_create_indexed_block(count, 1, displs, MPI_INT, &newtype);
@@ -71,6 +72,7 @@ int main(int argc, char **argv)
         MPI_Waitall(NUM_LOOPS, req, MPI_STATUSES_IGNORE);
 
     MPI_Barrier(MPI_COMM_WORLD);
+    free(req);
 
     /* test irsends */
     MPI_Type_create_indexed_block(count, 1, displs, MPI_INT, &newtype);
@@ -91,6 +93,8 @@ int main(int argc, char **argv)
     MPI_Waitall(NUM_LOOPS, req, MPI_STATUSES_IGNORE);
 
     MPI_Barrier(MPI_COMM_WORLD);
+    free(req);
+    free(displs);
 
     MPI_Finalize();