summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJackmcbarn <jackmcbarn@jackmcbarn.no-ip.org>2010-12-02 08:51:00 -0500
committerJackmcbarn <jackmcbarn@jackmcbarn.no-ip.org>2010-12-02 08:51:00 -0500
commit8c34dc0cc836e83d577ab402d0ae0a557b31d9b7 (patch)
treeb0dc7deaf2fb04e4f4b0cdb3970cbede2592f0e9 /src
parent017ec10c51eb81c85703cb0dad4a58b7954d0fd3 (diff)
Simplify ClearAllConnections code and fix possible crash
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_mssql.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp
index 7561fb2d8..cf94d4389 100644
--- a/src/modules/extra/m_mssql.cpp
+++ b/src/modules/extra/m_mssql.cpp
@@ -770,12 +770,9 @@ class ModuleMsSQL : public Module
void ClearAllConnections()
{
- ConnMap::iterator i;
- while ((i = connections.begin()) != connections.end())
- {
- connections.erase(i);
+ for(ConnMap::iterator i = connections.begin(); i != connections.end(); ++i)
delete i->second;
- }
+ connections.clear();
}
virtual void OnRehash(User* user)