Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitize the memory management
[simgrid.git] / src / xbt / xbt_host.c
index c668926..c2e8e56 100644 (file)
@@ -14,9 +14,9 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(host,xbt,"Host management");
 
 /** \brief constructor */
-xbt_host_t xbt_host_new(char *name, int port)  {
+xbt_host_t xbt_host_new(const char *name, int port)  {
    xbt_host_t res=xbt_new(s_xbt_host_t, 1);
-   res->name = name;
+   res->name = xbt_strdup(name);
    res->port = port;
    return res;
 }