Make struct Ban monolithic and improve memory statistics counting.
[ircu2.10.12-pk.git] / ircd / m_clearmode.c
index f3524307a0cf1fda9b4df970a53f1ba0de45c885..bd390f05bce3c73a84aaf971777ffe733401a550 100644 (file)
@@ -98,7 +98,7 @@
 #include "s_conf.h"
 #include "send.h"
 
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 
 /*
  * do_clearmode(struct Client *cptr, struct Client *sptr,
@@ -177,11 +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;
+                         bandup, 1);
       free_ban(link);
     }
 
@@ -252,7 +253,7 @@ ms_clearmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     return need_more_params(sptr, "CLEARMODE");
 
   if (!IsPrivileged(sptr)) {
-    protocol_violation(sptr,"No priviledges on source for CLEARMODE, desync?");
+    protocol_violation(sptr,"No privileges on source for CLEARMODE, desync?");
     return send_reply(sptr, ERR_NOPRIVILEGES);
   }