diff options
author | Adam <Adam@anope.org> | 2013-07-20 23:36:20 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-07-20 23:36:20 -0400 |
commit | 7480fbda2b308b914e942d36e9a29a9f7d7a5d5a (patch) | |
tree | 75cc4a511324fd2e80c0e49600878363a909df50 /modules/extra/m_ldap.cpp | |
parent | 9629ccb3745ed069ae906b7314638a5a0d9e2fa5 (diff) |
Fix removing old connections in m_ldap and m_mysql
Diffstat (limited to 'modules/extra/m_ldap.cpp')
-rw-r--r-- | modules/extra/m_ldap.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index 61410d274..15efbd62b 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -423,20 +423,21 @@ class ModuleLDAP : public Module, public Pipe void OnReload(Configuration::Conf *config) anope_override { - int i, num; + Configuration::Block *conf = config->GetModule(this); for (std::map<Anope::string, LDAPService *>::iterator it = this->LDAPServices.begin(); it != this->LDAPServices.end();) { const Anope::string &cname = it->first; LDAPService *s = it->second; + int i; + ++it; - Configuration::Block *conf = Config->GetModule(this); for (i = 0; i < conf->CountBlock("ldap"); ++i) if (conf->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main") == cname) break; - if (i == num) + if (i == conf->CountBlock("ldap")) { Log(LOG_NORMAL, "ldap") << "LDAP: Removing server connection " << cname; @@ -446,8 +447,7 @@ class ModuleLDAP : public Module, public Pipe } } - Configuration::Block *conf = config->GetModule(this); - for (i = 0; i < conf->CountBlock("ldap"); ++i) + for (int i = 0; i < conf->CountBlock("ldap"); ++i) { Configuration::Block *ldap = conf->GetBlock("ldap", i); |