X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cc37ec913eb0e9d729dd3107e3f39e4a1050c921..9cdec68b2b54eb8f8d4761b5b0a43600532ae61e:/examples/msg/icomms/peer2.c diff --git a/examples/msg/icomms/peer2.c b/examples/msg/icomms/peer2.c index 6a0d0fc1c4..d5d7c9566f 100644 --- a/examples/msg/icomms/peer2.c +++ b/examples/msg/icomms/peer2.c @@ -28,8 +28,7 @@ int sender(int argc, char *argv[]) double task_comm_size = atof(argv[3]); long receivers_count = atol(argv[4]); - msg_comm_t *comm = - malloc((number_of_tasks + receivers_count) * sizeof(msg_comm_t)); + msg_comm_t *comm = xbt_new(msg_comm_t, number_of_tasks + receivers_count); int i; m_task_t task = NULL; for (i = 0; i < number_of_tasks; i++) { @@ -55,6 +54,7 @@ int sender(int argc, char *argv[]) MSG_comm_waitall(comm, (number_of_tasks + receivers_count), -1); INFO0("Goodbye now!"); + xbt_free(comm); return 0; } /* end_of_sender */