]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Stability fixes, some DELETEs here that dont belong any more.
[user/henk/code/inspircd.git] / src / inspircd.cpp
index eb8894c4342f3e81653d54427ebc7f5e6f1522b8..858862e9dfa79c0ce06d05fbe9d3ddf1096fef84 100644 (file)
 #include <sys/resource.h>
 #include <dlfcn.h>
 #include <getopt.h>
-/* This is just to be completely certain that the change which fixed getrusage on RH7 doesn't break anything else -- Om */  
+
+/* Some systems don't define RUSAGE_SELF. This should fix them. */
 #ifndef RUSAGE_SELF
-#define RUSAGE_SELF 0
+       #define RUSAGE_SELF 0
 #endif
+
 #endif
 
 #include <exception>
@@ -963,7 +965,6 @@ bool InspIRCd::LoadModule(const char* filename)
                        {
                                this->Log(DEFAULT,"Unable to load %s: %s",modfile,factory[this->ModCount+1]->LastError());
                                snprintf(MODERR,MAXBUF,"Loader/Linker error: %s",factory[this->ModCount+1]->LastError());
-                               delete a;
                                return false;
                        }
                        if ((long)factory[this->ModCount+1]->factory != -1)
@@ -975,7 +976,6 @@ bool InspIRCd::LoadModule(const char* filename)
                                if (v.API != API_VERSION)
                                {
                                        delete m;
-                                       delete a;
                                        this->Log(DEFAULT,"Unable to load %s: Incorrect module API version: %d (our version: %d)",modfile,v.API,API_VERSION);
                                        snprintf(MODERR,MAXBUF,"Loader/Linker error: Incorrect module API version: %d (our version: %d)",v.API,API_VERSION);
                                        return false;
@@ -1003,8 +1003,6 @@ 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.");
-                               if (a)
-                                       delete a;
                                return false;
                        }
                }
@@ -1012,10 +1010,6 @@ bool InspIRCd::LoadModule(const char* filename)
                {
                        this->Log(DEFAULT,"Unable to load %s: %s",modfile,modexcept.GetReason());
                        snprintf(MODERR,MAXBUF,"Factory function of %s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
-                       if (m)
-                               delete m;
-                       if (a)
-                               delete a;
                        return false;
                }
        }