mirror of
https://github.com/anope/anope.git
synced 2026-06-26 21:16:39 +02:00
Replaced most uses of smalloc and scalloc with new, replaced most uses of free with delete.
NOTE: This build is unstable due to lack of memory zeroing, this will be addresses in a future commit. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1783 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+3
-3
@@ -45,7 +45,7 @@ Module::Module(const std::string &mname, const std::string &creator)
|
||||
lastHash = current;
|
||||
}
|
||||
|
||||
if ((newHash = (ModuleHash *)malloc(sizeof(ModuleHash))) == NULL) {
|
||||
if (!(newHash = new ModuleHash)) {
|
||||
fatal("Out of memory");
|
||||
}
|
||||
this->created = time(NULL);
|
||||
@@ -164,8 +164,8 @@ Module::~Module()
|
||||
} else {
|
||||
lastHash->next = mhash->next;
|
||||
}
|
||||
free(mhash->name);
|
||||
free(mhash);
|
||||
delete [] mhash->name;
|
||||
delete mhash;
|
||||
}
|
||||
lastHash = mhash;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user