Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2004-10-22 17:50:04 UTC

Modified files:
     ircd/m_clearmode.c ircd/channel.c

Log message:

Add comments explaining why we set banstr to NULL in two places.

---------------------- diff included ----------------------
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.107 ircu2.10/ircd/channel.c:1.108
--- ircu2.10/ircd/channel.c:1.107       Thu Oct 21 16:14:50 2004
+++ ircu2.10/ircd/channel.c     Fri Oct 22 10:49:51 2004
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Channel management and maintanance
- * @version $Id: channel.c,v 1.107 2004/10/21 23:14:50 entrope Exp $
+ * @version $Id: channel.c,v 1.108 2004/10/22 17:49:51 entrope Exp $
  */
 #include "config.h"
 
@@ -2964,7 +2964,8 @@
        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: ircu2.10/ircd/m_clearmode.c
diff -u ircu2.10/ircd/m_clearmode.c:1.26 ircu2.10/ircd/m_clearmode.c:1.27
--- ircu2.10/ircd/m_clearmode.c:1.26    Mon Oct 18 19:55:29 2004
+++ ircu2.10/ircd/m_clearmode.c Fri Oct 22 10:49:50 2004
@@ -21,7 +21,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_clearmode.c,v 1.26 2004/10/19 02:55:29 entrope Exp $
+ * $Id: m_clearmode.c,v 1.27 2004/10/22 17:49:50 entrope Exp $
  */
 
 /*
@@ -181,7 +181,8 @@
 
       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);
     }
 
----------------------- End of diff -----------------------

Reply via email to