Make struct Ban monolithic and improve memory statistics counting.
[ircu2.10.12-pk.git] / ircd / m_clearmode.c
index 8d45c607bc0636f26a21594e6793af7a881d1b3c..bd390f05bce3c73a84aaf971777ffe733401a550 100644 (file)
@@ -177,12 +177,12 @@ do_clearmode(struct Client *cptr, struct Client *sptr, struct Channel *chptr,
    */
   if (del_mode & MODE_BAN) {
     for (link = chptr->banlist; link; link = next) {
+      char *bandup;
       next = link->next;
 
+      DupString(bandup, link->banstr);
       modebuf_mode_string(&mbuf, MODE_DEL | MODE_BAN, /* delete ban */
-                         link->banstr, 1);
-      link->banstr = NULL; /* modebuf_mode_string() gave ownership of
-                            * banstr to mbuf */
+                         bandup, 1);
       free_ban(link);
     }