- Added some tools to detect memory leaks.
[ircu2.10.12-pk.git] / ircd / chkconf.c
index 15e8ff48db620f358f306a159952f976729f7e9a..0169c63dab0ffca8dae7a3b609e8c6f812a50c99 100644 (file)
@@ -18,6 +18,8 @@
  *
  * $Id$
  */
+#include "config.h"
+
 #include "s_conf.h"
 #include "client.h"
 #include "class.h"
@@ -55,6 +57,8 @@
 #define CONF_KLINE              (CONF_KILL | CONF_IPKILL)
 #define CONF_CRULE              (CONF_CRULEALL | CONF_CRULEAUTO)
 
+/* DEFAULTMAXSENDQLENGTH went into the features subsystem... */
+#define DEFAULTMAXSENDQLENGTH 40000
 
 /*
  * For the connect rule patch..  these really should be in a header,
@@ -73,7 +77,7 @@ static struct ConfItem *chk_initconf(void);
 static struct ConnectionClass *get_class(int cn, int ism);
 
 static int numclasses = 0, *classarr = (int *)NULL, debugflag = 0;
-static char *chk_configfile = CPATH;
+static char *chk_configfile = "";
 static char nullfield[] = "";
 static char maxsendq[12];
 
@@ -101,7 +105,7 @@ char *rpl_str(int numeric)
 
 int main(int argc, char *argv[])
 {
-  const char *dpath = DPATH;
+  const char *dpath = "./";
   chk_configfile = "ircd.conf";
 
   while (argc > 1)
@@ -501,10 +505,14 @@ static struct ConnectionClass *get_class(int cn, int ism)
 static void new_class(int cn)
 {
   numclasses++;
-  if (classarr)
-    classarr = (int *)MyRealloc(classarr, sizeof(int) * numclasses);
+  if (classarr && numclasses & 0xF == 0)
+  {
+    int **tmp_arr = MyMalloc(classarr * (numclasses + 0x10));
+    MyFree(classarr);
+    memcpy(tmp_arr, classarr, classarr * (numclasses - 1));
+  }
   else
-    classarr = (int *)MyMalloc(sizeof(int));
+    classarr = (int *)MyMalloc(sizeof(int) * numclasses);
   classarr[numclasses - 1] = cn;
 }