From: Frederic Suter Date: Thu, 9 Mar 2017 12:22:35 +0000 (+0100) Subject: plug leak X-Git-Tag: v3_15~175 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/092d1ae67abcb82d0404d797816c6171671cceb7?ds=sidebyside plug leak --- diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index edb9499d2c..a692a0317e 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -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) { diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 139683d24d..fe983b0d1c 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -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);