Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix memory leaks
authorthiery <thiery@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 10:11:05 +0000 (10:11 +0000)
committerthiery <thiery@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 10:11:05 +0000 (10:11 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9048 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/msg/msg_mailbox.c
src/surf/surf_routing.c

index c49896e..c434fdc 100644 (file)
@@ -97,6 +97,7 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task,
   TRY {
     comm = SIMIX_req_comm_irecv(mailbox, task, NULL);
     SIMIX_req_comm_wait(comm, timeout);
+    SIMIX_req_comm_destroy(comm);
     DEBUG2("Got task %s from %p",(*task)->name,mailbox);
     (*task)->simdata->refcount--;
   }
@@ -166,6 +167,7 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task,
     SIMIX_req_set_category(t_simdata->comm, task->category);
 #endif
     SIMIX_req_comm_wait(t_simdata->comm, timeout);
+    SIMIX_req_comm_destroy(t_simdata->comm);
   }
 
   CATCH(e) {
index 3f4c7fb..62791d4 100644 (file)
@@ -863,6 +863,8 @@ static double _get_latency(const char *src, const char *dst)
   }
 
   xbt_dynar_free(&elem_father_list);
+  xbt_dynar_free(&e_route->generic_route.link_list);
+  xbt_free(e_route);
 
   return latency;
 }
@@ -944,6 +946,7 @@ static double get_latency(const char *src, const char *dst)
     latency = (*(common_father->get_latency)) (common_father, src, dst);
 
   xbt_assert2(latency>=0.0, "no route between \"%s\" and \"%s\"", src, dst);
+  xbt_dynar_free(&elem_father_list);
 
   return latency;
 }
@@ -2872,6 +2875,7 @@ static double generic_get_link_latency(routing_component_t rc,
        xbt_dynar_foreach(route->generic_route.link_list,i,link) {
                latency += get_link_latency(link);
        }
+       generic_free_extended_route(route);
   return latency;
 }