Fix bug when reading already freed memory
[anna.git] / source / diameter / stack / Dictionary.cpp
index e369d43..68f37c1 100644 (file)
@@ -41,8 +41,9 @@ LOGNOTICE(\
    trace += "\n";\
    anna::Logger::notice(trace, ANNA_FILE_LOCATION);\
 );\
+std::string name = found->getName();\
 pool.erase(pool.find(found->getId()));\
-poolNames.erase(poolNames.find(found->getName()));
+poolNames.erase(poolNames.find(name));
 
 
 //------------------------------------------------------------------------------