summaryrefslogtreecommitdiff
path: root/src/modules/cs_appendtopic.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/modules/cs_appendtopic.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/modules/cs_appendtopic.c')
-rw-r--r--src/modules/cs_appendtopic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/cs_appendtopic.c b/src/modules/cs_appendtopic.c
index 0e4ba12f8..01b7dc544 100644
--- a/src/modules/cs_appendtopic.c
+++ b/src/modules/cs_appendtopic.c
@@ -191,7 +191,7 @@ int my_cs_appendtopic(User * u)
if (ci->last_topic) {
snprintf(topic, sizeof(topic), "%s %s", ci->last_topic,
newtopic);
- free(ci->last_topic);
+ delete [] ci->last_topic;
} else {
strscpy(topic, newtopic, sizeof(topic));
}
@@ -201,7 +201,7 @@ int my_cs_appendtopic(User * u)
ci->last_topic_time = time(NULL);
if (c->topic)
- free(c->topic);
+ delete [] c->topic;
c->topic = *topic ? sstrdup(topic) : NULL;
strscpy(c->topic_setter, u->nick, NICKMAX);
if (ircd->topictsbackward)
@@ -225,6 +225,8 @@ int my_cs_appendtopic(User * u)
}
}
}
+ if (newtopic) delete [] newtopic;
+ if (chan) delete [] chan;
return MOD_CONT;
}