summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-18 22:53:37 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-18 22:53:37 +0000
commit8d6ca820a704064870c713efd3c325d54bf17d90 (patch)
tree5efbd49829b6ccb3aa8f4cfb8a375e2346c09020
parent61838d28cf0d1323edb2ec4acccfb36a5d96fe00 (diff)
Helps if it compiles
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7389 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspircd.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 3e063c26b..eb8894c43 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -954,9 +954,10 @@ bool InspIRCd::LoadModule(const char* filename)
}
}
Module* m = NULL;
+ ircd_module* a = NULL;
try
{
- ircd_module* a = new ircd_module(this, modfile);
+ a = new ircd_module(this, modfile);
factory[this->ModCount+1] = a;
if (factory[this->ModCount+1]->LastError())
{
@@ -1002,7 +1003,8 @@ bool InspIRCd::LoadModule(const char* filename)
{
this->Log(DEFAULT,"Unable to load %s",modfile);
snprintf(MODERR,MAXBUF,"Factory function failed: Probably missing init_module() entrypoint.");
- delete a;
+ if (a)
+ delete a;
return false;
}
}
@@ -1012,7 +1014,8 @@ bool InspIRCd::LoadModule(const char* filename)
snprintf(MODERR,MAXBUF,"Factory function of %s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
if (m)
delete m;
- delete a;
+ if (a)
+ delete a;
return false;
}
}