Add comments explaining why we set banstr to NULL in two places.
authorMichael Poole <mdpoole@troilus.org>
Fri, 22 Oct 2004 17:49:51 +0000 (17:49 +0000)
committerMichael Poole <mdpoole@troilus.org>
Fri, 22 Oct 2004 17:49:51 +0000 (17:49 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1256 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ircd/channel.c
ircd/m_clearmode.c

index 534e3174683bfff7eb72c994611e3a45b9de5f4a..249bba143025cc3bc169354f29a7eb62f55a96fa 100644 (file)
@@ -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++;
index f3524307a0cf1fda9b4df970a53f1ba0de45c885..c8d3516be58eaa1b85b6db2076c2242bbd24af2c 100644 (file)
@@ -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);
     }