Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
More memory leaks.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 23 Sep 2013 21:01:03 +0000 (23:01 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 23 Sep 2013 21:01:03 +0000 (23:01 +0200)
src/surf/surf_routing.c
src/surf/surf_routing_vivaldi.c

index 683f037..53a519b 100644 (file)
@@ -1079,6 +1079,7 @@ static void routing_parse_peer(sg_platf_peer_cbarg_t peer)
   XBT_DEBUG(" ");
 
   //xbt_dynar_free(&tab_elements_num);
   XBT_DEBUG(" ");
 
   //xbt_dynar_free(&tab_elements_num);
+  free(router_id);
   free(host_id);
   free(link_id);
   free(link_up);
   free(host_id);
   free(link_id);
   free(link_up);
index a7e0cce..936a847 100644 (file)
@@ -27,8 +27,14 @@ static void vivaldi_get_route_and_latency(
   char *dst = (char*)dst_p->name;
 
   if(src_p->rc_type == SURF_NETWORK_ELEMENT_AS) {
   char *dst = (char*)dst_p->name;
 
   if(src_p->rc_type == SURF_NETWORK_ELEMENT_AS) {
-    route->gw_src = xbt_lib_get_or_null(as_router_lib,ROUTER_PEER(src),ROUTING_ASR_LEVEL);
-    route->gw_dst = xbt_lib_get_or_null(as_router_lib,ROUTER_PEER(dst),ROUTING_ASR_LEVEL);
+    char *rp_src = ROUTER_PEER(src);
+    char *rp_dst = ROUTER_PEER(dst);
+    route->gw_src = xbt_lib_get_or_null(as_router_lib, rp_src,
+                                        ROUTING_ASR_LEVEL);
+    route->gw_dst = xbt_lib_get_or_null(as_router_lib, rp_dst,
+                                        ROUTING_ASR_LEVEL);
+    xbt_free(rp_src);
+    xbt_free(rp_dst);
   }
 
   double euclidean_dist;
   }
 
   double euclidean_dist;