summaryrefslogtreecommitdiff
path: root/src/module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/module.cpp')
-rw-r--r--src/module.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/module.cpp b/src/module.cpp
index de72c7f64..2df2aaa58 100644
--- a/src/module.cpp
+++ b/src/module.cpp
@@ -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;
}