Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug leak
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 9 Mar 2017 12:22:35 +0000 (13:22 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 9 Mar 2017 12:22:35 +0000 (13:22 +0100)
src/surf/HostImpl.cpp
src/surf/sg_platf.cpp

index edb9499..a692a03 100644 (file)
@@ -107,7 +107,11 @@ HostImpl::HostImpl(s4u::Host* host) : piface_(host)
 }
 
 /** @brief use destroy() instead of this destructor */
-HostImpl::~HostImpl() = default;
+HostImpl::~HostImpl()
+{
+  for (auto mnt : storage_)
+    xbt_free(mnt.name);
+}
 
 simgrid::surf::Storage* HostImpl::findStorageOnMountList(const char* mount)
 {
index 139683d..fe983b0 100644 (file)
@@ -425,12 +425,6 @@ void sg_platf_new_storage_type(sg_platf_storage_type_cbarg_t storage_type){
       (void *) stype);
 }
 
-static void mount_free(void *p)
-{
-  mount_t mnt = (mount_t) p;
-  xbt_free(mnt->name);
-}
-
 void sg_platf_new_mount(sg_platf_mount_cbarg_t mount){
   xbt_assert(xbt_lib_get_or_null(storage_lib, mount->storageId, ROUTING_STORAGE_LEVEL),
       "Cannot mount non-existent disk \"%s\"", mount->storageId);