From 26f48e3db3738d9bee7e317f7aa43f53e4ee1bb4 Mon Sep 17 00:00:00 2001 From: danieldg Date: Tue, 9 Feb 2010 21:04:14 +0000 Subject: 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 --- src/modmanager_dynamic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.2.3