From c68005649fcf206baab17d27e8b68aa59b9a3e38 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 10 Nov 2007 20:04:39 +0000 Subject: Fix crashes found by owine (usually on startup) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8559 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cloaking.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index e1b8db61f..43a0f5693 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -322,8 +322,6 @@ class ModuleCloaking : public Module /* Create new mode handler object */ cu = new CloakUser(ServerInstance, this, HashModule); - OnRehash(NULL,""); - /* Attempt to locate the md5 service provider, bail if we can't find it */ HashModule = ServerInstance->Modules->Find("m_md5.so"); if (!HashModule) @@ -332,6 +330,16 @@ class ModuleCloaking : public Module throw ModuleException("Can't find m_md5.so. Please load m_md5.so before m_cloaking.so."); } + try + { + OnRehash(NULL,""); + } + catch (CoreException &e) + { + delete cu; + throw e; + } + /* Register it with the core */ if (!ServerInstance->AddMode(cu)) { -- cgit v1.2.3