diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-10 21:07:41 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-10 21:07:41 +0000 |
commit | 5f67bfbc8eec11189b0e60dbcee4bd273cbb1cc8 (patch) | |
tree | 5f7096e79e277ddbfaba63639a4d442558f6b2b7 /src | |
parent | ddbde2059831e1532cfc0c453d61633bdccc8b2d (diff) |
Fix possible sqllog crash (working blind here!) where it could attempt to delete a pointer without knowing if that pointer was valid. (NEVER EVER use operator[] to lookup a map value, always use ::find())
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7700 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/extra/m_sqllog.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp index 391e4bbba..d572ae92f 100644 --- a/src/modules/extra/m_sqllog.cpp +++ b/src/modules/extra/m_sqllog.cpp @@ -166,8 +166,12 @@ public: break; case DONE: - delete active_queries[req.id]; - active_queries[req.id] = NULL; + std::map<unsigned long,QueryInfo*>::iterator x = active_queries.find(req.id); + if (x != active_queres.end()) + { + delete x->second; + active_queries.erase(x); + } break; } } |