Fix bugs and memory leaks in ban management.
[ircu2.10.12-pk.git] / ircd / m_silence.c
index a3baa5124a6c8f279edc55f5d35f06d192298dc2..1be8a4b25218ace34081980b53f2634833b6fdae 100644 (file)
@@ -32,6 +32,7 @@
 #include "hash.h"
 #include "ircd.h"
 #include "ircd_features.h"
+#include "ircd_log.h"
 #include "ircd_reply.h"
 #include "ircd_snprintf.h"
 #include "ircd_string.h"
@@ -43,7 +44,7 @@
 #include "send.h"
 #include "struct.h"
 
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 #include <stdlib.h>
 #include <string.h>
 
@@ -85,7 +86,7 @@ apply_silence(struct Client *sptr, const char *mask)
   /* Make the silence, set flags, and apply it. */
   sile = make_ban(mask);
   sile->flags |= flags;
-  return apply_ban(&cli_user(sptr)->silence, sile) ? NULL : sile;
+  return apply_ban(&cli_user(sptr)->silence, sile, 1) ? NULL : sile;
 }
 
 /** Apply and send silence updates for a user.