Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix leaks and invalid read
[simgrid.git] / src / surf / storage_n11.cpp
index 289e657..cfe41f8 100644 (file)
@@ -406,7 +406,7 @@ StorageActionPtr StorageN11::ls(const char* path)
   return action;
 }
 
-StorageActionPtr StorageN11::open(char* mount, char* path)
+StorageActionPtr StorageN11::open(const char* mount, const char* path)
 {
   XBT_DEBUG("\tOpen file '%s'",path);
 
@@ -430,8 +430,6 @@ StorageActionPtr StorageN11::open(char* mount, char* path)
 
   StorageActionPtr action = new StorageN11Action(getModel(), 0, getState() != SURF_RESOURCE_ON, this, OPEN);
   action->p_file = file;
-  free(path);
-  free(mount);
 
   return action;
 }