From: mquinson Date: Tue, 4 Apr 2006 08:25:43 +0000 (+0000) Subject: Make sure we don't change a timeout=0 into a timeout<0, because in select it would... X-Git-Tag: v3.3~3300 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0ad4eb7e2cb900265a1cfa7c330feb1bffa7c526 Make sure we don't change a timeout=0 into a timeout<0, because in select it would change from non-blocking into endless blocking; plug a memleak around exception propagation git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2058 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Msg/msg.c b/src/gras/Msg/msg.c index 5b02e5cd6e..7a1f42a6da 100644 --- a/src/gras/Msg/msg.c +++ b/src/gras/Msg/msg.c @@ -292,7 +292,7 @@ gras_msg_wait_ext(double timeout, while (1) { memset(&msg,sizeof(msg),0); - msg.expe = gras_trp_select(timeout - now + start); + msg.expe = gras_trp_select(timeout ? timeout - now + start : 0); gras_msg_recv(msg.expe, &msg); DEBUG0("Got a message from the socket"); @@ -485,6 +485,7 @@ gras_msg_handle(double timeOut) { } } } CATCH(e) { + free(msg.payl); if (msg.type->kind == e_gras_msg_kind_rpccall) { /* The callback raised an exception, propagate it on the network */ e.host = (char*)gras_os_myname(); @@ -518,7 +519,7 @@ gras_msg_handle(double timeOut) { default: THROW1(unknown_error,0, - "Cannot handle messages of kind %d yet",msg.type->kind); + "Cannot handle messages of kind %d yet",msg.type->kind); } }