summaryrefslogtreecommitdiff
path: root/src/memory.c
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-22 01:11:19 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-22 01:11:19 +0000
commit16e667a2cecf9492954333fc7949b6636072f941 (patch)
tree746164afdc56c0a30dea0f1736c4129c1f1ad422 /src/memory.c
parent1532aa675f7c28b8ff0061ebc21f374d36d89d65 (diff)
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
Diffstat (limited to 'src/memory.c')
-rw-r--r--src/memory.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/memory.c b/src/memory.c
index 30fe46627..cf928021b 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -6,9 +6,9 @@
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
- * $Id$
+ * Based on the original code of Services by Andy Church.
+ *
+ * $Id$
*
*/
@@ -107,19 +107,14 @@ char *sstrdup(const char *src)
{
char *ret = NULL;
if (src) {
-#ifdef __STRICT_ANSI__
- if ((ret = (char *) malloc(strlen(src) + 1))) {;
- strcpy(ret, src);
- }
-#else
- ret = strdup(src);
-#endif
+ ret = new char[strlen(src) + 1];
if (!ret)
#ifndef _WIN32
raise(SIGUSR1);
#else
abort();
#endif
+ strcpy(ret, src);
} else {
alog("sstrdup() called with NULL-arg");
if (debug)