From fa0d664063d479759073629f5d183a6266a428f0 Mon Sep 17 00:00:00 2001 From: rburchell Date: Sun, 22 Feb 2009 17:20:30 +0000 Subject: Forward port of patch by DukePyrolator fixing memory leak on +beI modes. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2124 5417fbe8-f217-4b02-8779-1006273d7864 --- src/channels.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/channels.c b/src/channels.c index f28059250..e79e8f902 100644 --- a/src/channels.c +++ b/src/channels.c @@ -762,7 +762,7 @@ void do_sjoin(const char *source, int ac, const char **av) Server *serv; struct c_userlist *cu; const char *s = NULL; - char *end, cubuf[7], *end2; + char *buf, *end, cubuf[7], *end2; const char *modes[6]; int is_sqlined = 0; int ts = 0; @@ -823,7 +823,9 @@ void do_sjoin(const char *source, int ac, const char **av) if (ircd->sjoinbanchar) { if (*s == ircd->sjoinbanchar && keep_their_modes) { - add_ban(c, myStrGetToken(s, ircd->sjoinbanchar, 1)); + buf = myStrGetToken(s, ircd->sjoinbanchar, 1); + add_ban(c, buf); + delete [] buf; if (!end) break; s = end + 1; @@ -832,8 +834,9 @@ void do_sjoin(const char *source, int ac, const char **av) } if (ircd->sjoinexchar) { if (*s == ircd->sjoinexchar && keep_their_modes) { - add_exception(c, - myStrGetToken(s, ircd->sjoinexchar, 1)); + buf = myStrGetToken(s, ircd->sjoinexchar, 1); + add_exception(c, buf); + delete [] buf; if (!end) break; s = end + 1; @@ -843,7 +846,9 @@ void do_sjoin(const char *source, int ac, const char **av) if (ircd->sjoininvchar) { if (*s == ircd->sjoininvchar && keep_their_modes) { - add_invite(c, myStrGetToken(s, ircd->sjoininvchar, 1)); + buf = myStrGetToken(s, ircd->sjoininvchar, 1); + add_invite(c, buf); + delete [] buf; if (!end) break; s = end + 1; -- cgit