Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_clearmode.c
index d2f99b158a76b15f999ee9432d38810ac57efa68..35ddea9cffb587393f95d9b8c3e2ec15cbe8fd91 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * IRC - Internet Relay Chat, ircd/m_tmpl.c
+ * IRC - Internet Relay Chat, ircd/m_clearmode.c
  * Copyright (C) 1990 Jarkko Oikarinen and
  *                    University of Oulu, Computing Center
  * Copyright (C) 2000 Kevin L. Mitchell <klmitch@mit.edu>
@@ -97,9 +97,8 @@
 #include "numnicks.h"
 #include "s_conf.h"
 #include "send.h"
-#include "support.h"
 
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 
 /*
  * do_clearmode(struct Client *cptr, struct Client *sptr,
@@ -132,7 +131,7 @@ do_clearmode(struct Client *cptr, struct Client *sptr, struct Channel *chptr,
   char control_buf[20];
   int control_buf_i = 0;
   struct ModeBuf mbuf;
-  struct SLink *link, *next;
+  struct Ban *link, *next;
   struct Membership *member;
 
   /* Ok, so what are we supposed to get rid of? */
@@ -181,10 +180,10 @@ do_clearmode(struct Client *cptr, struct Client *sptr, struct Channel *chptr,
       next = link->next;
 
       modebuf_mode_string(&mbuf, MODE_DEL | MODE_BAN, /* delete ban */
-                         link->value.ban.banstr, 1);
-
-      MyFree(link->value.ban.who); /* free up who string */
-      free_link(link); /* and of course the link itself */
+                         link->banstr, 1);
+      link->banstr = NULL; /* modebuf_mode_string() gave ownership of
+                            * banstr to mbuf */
+      free_ban(link);
     }
 
     chptr->banlist = 0;