From: Arnaud Giersch Date: Mon, 21 Nov 2011 11:23:26 +0000 (+0100) Subject: Need to have my own link list. X-Git-Tag: exp_20120216~241^2~57 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3736e0252d96679e19cfbe41f3c09833d3734386?hp=9aa23d528c48b1567e7277fb78807397c9960237 Need to have my own link list. Else, it is freed while I'm still using it. --- diff --git a/src/surf/surf_routing_floyd.c b/src/surf/surf_routing_floyd.c index 337ca87bd5..ea030ea1fd 100644 --- a/src/surf/surf_routing_floyd.c +++ b/src/surf/surf_routing_floyd.c @@ -104,7 +104,8 @@ static void floyd_get_route_and_latency(AS_t asg, const char *src, const char *d if (asg->hierarchy == SURF_ROUTING_RECURSIVE && !first && strcmp(gw_dst, prev_gw_src)) { - xbt_dynar_t e_route_as_to_as=NULL; + xbt_dynar_t e_route_as_to_as; + e_route_as_to_as = xbt_dynar_new(global_routing->size_of_link, NULL); routing_get_route_and_latency(gw_dst, prev_gw_src,&e_route_as_to_as,NULL); links = e_route_as_to_as; int pos = 0; @@ -114,6 +115,7 @@ static void floyd_get_route_and_latency(AS_t asg, const char *src, const char *d *lat += surf_network_model->extension.network.get_link_latency(link); pos++; } + xbt_dynar_free(&e_route_as_to_as); } links = e_route->link_list;