Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use C++ strings instead of char*.
[simgrid.git] / src / surf / sg_platf.cpp
index f8d7e4d..6966739 100644 (file)
@@ -131,12 +131,11 @@ void sg_platf_new_link(LinkCreationArgs* link)
   }
   for (auto const& link_name : names) {
     simgrid::surf::LinkImpl* l =
-        surf_network_model->createLink(link_name.c_str(), link->bandwidth, link->latency, link->policy);
+        surf_network_model->createLink(link_name, link->bandwidth, link->latency, link->policy);
 
     if (link->properties) {
       for (auto const& elm : *link->properties)
         l->setProperty(elm.first, elm.second);
-      delete link->properties;
     }
 
     if (link->latency_trace)
@@ -146,6 +145,7 @@ void sg_platf_new_link(LinkCreationArgs* link)
     if (link->state_trace)
       l->setStateTrace(link->state_trace);
   }
+  delete link->properties;
 }
 
 void sg_platf_new_cluster(ClusterCreationArgs* cluster)