From: mquinson Date: Sun, 12 Apr 2009 02:27:20 +0000 (+0000) Subject: plug some memleaks X-Git-Tag: v3.3~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a047de5c152b0d2ecf8f85c8be79581aa0c93464 plug some memleaks git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6245 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/examples/gras/all2all/all2all.c b/examples/gras/all2all/all2all.c index 59e0a34728..9efad7173c 100644 --- a/examples/gras/all2all/all2all.c +++ b/examples/gras/all2all/all2all.c @@ -56,6 +56,7 @@ int receiver (int argc,char *argv[]) { &expeditor, &data); todo--; + free(data); INFO3("Got Data from %s:%d (still %d to go)", gras_socket_peer_name(expeditor), gras_socket_peer_port(expeditor), diff --git a/src/gras/Msg/gras_msg_listener.c b/src/gras/Msg/gras_msg_listener.c index 27649e99d8..c7f4099fd5 100644 --- a/src/gras/Msg/gras_msg_listener.c +++ b/src/gras/Msg/gras_msg_listener.c @@ -42,10 +42,13 @@ static void listener_function(void *p) { char got = *(char*)msg.payl; if (got == '1') { VERB0("Asked to get awake"); + free(msg.payl); } else { VERB0("Asked to die"); +// gras_socket_close(me->wakeup_sock_listener_side); + free(msg.payl); return ; - } + } } /* empty the list of sockets to trash */ TRY { @@ -107,6 +110,7 @@ void gras_msg_listener_shutdown(gras_msg_listener_t l) { if (gras_if_RL()) xbt_thread_join(pd->listener->listener); +// gras_socket_close(pd->listener->wakeup_sock_master_side); FIXME: uncommenting this leads to deadlock at terminaison xbt_queue_free(&l->incomming_messages); xbt_queue_free(&l->socks_to_close); xbt_free(l); diff --git a/src/gras/Virtu/gras_module.c b/src/gras/Virtu/gras_module.c index 8969f5eac1..177a3eda97 100644 --- a/src/gras/Virtu/gras_module.c +++ b/src/gras/Virtu/gras_module.c @@ -85,6 +85,7 @@ static xbt_set_t _gras_modules = NULL; /* content: s_gras_module_t */ static void gras_module_freep(void *p) { free( ((gras_module_t)p) ->name); + free(p); } diff --git a/src/xbt/xbt_sg_synchro.c b/src/xbt/xbt_sg_synchro.c index 120a1f255a..00dd1a4723 100644 --- a/src/xbt/xbt_sg_synchro.c +++ b/src/xbt/xbt_sg_synchro.c @@ -32,6 +32,8 @@ static int xbt_thread_create_wrapper(int argc, char *argv[]) { xbt_thread_t t = (xbt_thread_t)SIMIX_process_get_data(SIMIX_process_self()); SIMIX_process_set_data(SIMIX_process_self(),t->father_data); (*t->code)(t->userparam); + free(t->name); + free(t); return 0; }