From: Frederic Suter Date: Fri, 24 Mar 2017 12:28:35 +0000 (+0100) Subject: match new with delete in fact X-Git-Tag: v3.16~454 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/215555956513ba0d24707980da429e3c4a4a37a6 match new with delete in fact --- diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index 81faf9574b..9e5602fd0c 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -289,7 +289,7 @@ int HostImpl::fileMove(surf_file_t fd, const char* fullpath) std::map* content = findStorageOnMountList(fd->mount)->content_; if (content->find(fd->name) != content->end()) { // src file exists sg_size_t* psize = content->at(std::string(fd->name)); - sg_size_t* new_psize = xbt_new(sg_size_t, 1); + sg_size_t* new_psize = new sg_size_t; *new_psize = *psize; delete psize; content->erase(fd->name); diff --git a/src/surf/storage_interface.cpp b/src/surf/storage_interface.cpp index 831e5143d0..799f67c41d 100644 --- a/src/surf/storage_interface.cpp +++ b/src/surf/storage_interface.cpp @@ -78,7 +78,7 @@ Storage::~Storage(){ storageDestructedCallbacks(this); if (content_ != nullptr) { for (auto entry : *content_) - free(entry.second); + delete entry.second; delete content_; } free(typeId_);