From: Michael Poole Date: Fri, 22 Oct 2004 17:49:51 +0000 (+0000) Subject: Add comments explaining why we set banstr to NULL in two places. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=7f9d6fd7932fe0b2d6f69cd2d99710cc9a1c56ef Add comments explaining why we set banstr to NULL in two places. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1256 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ircd/channel.c b/ircd/channel.c index 534e317..249bba1 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -2964,7 +2964,8 @@ mode_process_bans(struct ParseState *state) count--; len -= banlen; - ban->banstr = NULL; /* do not free this string */ + ban->banstr = NULL; /* modebuf_mode_string() gave ownership of + * the ban string to state->mbuf */ free_ban(ban); changed++; diff --git a/ircd/m_clearmode.c b/ircd/m_clearmode.c index f352430..c8d3516 100644 --- a/ircd/m_clearmode.c +++ b/ircd/m_clearmode.c @@ -181,7 +181,8 @@ do_clearmode(struct Client *cptr, struct Client *sptr, struct Channel *chptr, modebuf_mode_string(&mbuf, MODE_DEL | MODE_BAN, /* delete ban */ link->banstr, 1); - link->banstr = NULL; + link->banstr = NULL; /* modebuf_mode_string() gave ownership of + * banstr to mbuf */ free_ban(link); }