Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug a memleak. I should beter kill that XBT container instead
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Feb 2017 02:24:58 +0000 (03:24 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Feb 2017 02:24:58 +0000 (03:24 +0100)
src/s4u/s4u_engine.cpp

index 085e4e6..0fc822e 100644 (file)
@@ -102,8 +102,10 @@ static s4u::NetZone* netzoneByNameRecursive(s4u::NetZone* current, const char* n
   NetZone_t elem;
   xbt_dict_foreach(current->children(), cursor, key, elem) {
     simgrid::s4u::NetZone* tmp = netzoneByNameRecursive(elem, name);
-    if (tmp != nullptr )
-        return tmp;
+    if (tmp != nullptr) {
+      xbt_dict_cursor_free(&cursor);
+      return tmp;
+    }
   }
   return nullptr;
 }