1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 07:26:38 +02:00

# BUILD : 1.7.13 (999)

# BUGS  : 430
# NOTES : Fixed memleak in do_cmode()

git-svn-id: svn://svn.anope.org/anope/trunk@999 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@724 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b
2006-03-02 08:55:57 +00:00
parent b90dfa435a
commit 0f18525a2c
3 changed files with 38 additions and 6 deletions
+1
View File
@@ -30,6 +30,7 @@ Provided by Anope Dev. <dev@anope.org> - 2006
03/01 F Fixed memleaks in hs_set.c. [#441]
04/01 F Fixed missing TS6 functionality in channels.c. [#418]
04/01 F Fixed possible overflow in process(). [#445]
04/01 F Fixed memleak in do_cmode(). [#430]
Provided by nenolod. <nenolod@nenolod.net> - 2006
02/03 A Support for Charybdis IRCd. [ #00]
+31 -4
View File
@@ -1101,7 +1101,7 @@ void do_cmode(const char *source, int ac, char **av)
{
Channel *chan;
ChannelInfo *ci = NULL;
int i;
int i, tofree0 = 0, tofree1 = 0, tofree2 = 0;
char *t;
if (ircdcap->tsmode) {
@@ -1133,9 +1133,24 @@ void do_cmode(const char *source, int ac, char **av)
if (debug) {
alog("debug: Before TS6 swap: do_cmode() chan %s : mode %s : extra %s", av[1], av[2], av[3]);
}
av[0] = (ac >= 2 ? sstrdup(av[1]) : NULL);
av[1] = (ac >= 3 ? sstrdup(av[2]) : NULL);
av[2] = (ac >= 4 ? sstrdup(av[3]) : NULL);
if (ac >= 2) {
av[0] = sstrdup(av[1]);
tofree0 = 1;
} else {
av[0] = NULL;
}
if (ac >= 3) {
av[1] = sstrdup(av[2]);
tofree1 = 1;
} else {
av[1] = NULL;
}
if (ac >= 4) {
av[2] = sstrdup(av[3]);
tofree2 = 1;
} else {
av[2] = NULL;
}
if (debug) {
alog("debug: After TS swap: do_cmode() chan %s : mode %s : extra %s", av[0], av[1], av[2]);
}
@@ -1154,6 +1169,12 @@ void do_cmode(const char *source, int ac, char **av)
alog("debug: MODE %s for nonexistent channel %s",
merge_args(ac - 1, av + 1), av[0]);
}
if (tofree0)
free(av[0];
if (tofree1)
free(av[1];
if (tofree2)
free(av[2];
return;
}
@@ -1169,6 +1190,12 @@ void do_cmode(const char *source, int ac, char **av)
ac--;
av++;
chan_set_modes(source, chan, ac, av, 1);
if (tofree1)
free(av[0];
if (tofree2)
free(av[1];
if (tofree3)
free(av[2];
}
/*************************************************************************/
+6 -2
View File
@@ -9,13 +9,17 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="13"
VERSION_EXTRA="-svn"
VERSION_BUILD="998"
VERSION_BUILD="999"
# $Log$
#
# BUILD : 1.7.13 (999)
# BUGS : 430
# NOTES : Fixed memleak in do_cmode()
#
# BUILD : 1.7.13 (998)
# BUGS : 445
# NOTES : Tixed possible overflow in process()
# NOTES : Fixed possible overflow in process()
#
# BUILD : 1.7.13 (997)
# BUGS : 418