summaryrefslogtreecommitdiff
path: root/src/modmanager_dynamic.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-09 21:04:14 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-09 21:04:14 +0000
commit26f48e3db3738d9bee7e317f7aa43f53e4ee1bb4 (patch)
tree48ff64179e5d46be6f478a5463e3f8c5f3281f95 /src/modmanager_dynamic.cpp
parent76f9f4b47a16888d93bdb6122de0e1f6d7965f4b (diff)
Fix double-free when catching an exception in module init()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12415 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modmanager_dynamic.cpp')
-rw-r--r--src/modmanager_dynamic.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modmanager_dynamic.cpp b/src/modmanager_dynamic.cpp
index 40bced74a..fa6b119a0 100644
--- a/src/modmanager_dynamic.cpp
+++ b/src/modmanager_dynamic.cpp
@@ -110,8 +110,8 @@ bool ModuleManager::Load(const char* filename)
// failure in module constructor
if (newmod)
DoSafeUnload(newmod);
- delete newmod;
- delete newhandle;
+ else
+ delete newhandle;
LastModuleError = "Unable to load " + filename_str + ": " + modexcept.GetReason();
ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError);
return false;