Patch memory leak. Don't try to trace when tracing's turned off.
authormdw <mdw>
Wed, 20 Aug 1997 16:16:13 +0000 (16:16 +0000)
committermdw <mdw>
Wed, 20 Aug 1997 16:16:13 +0000 (16:16 +0000)
src/class.c

index faae653..990822d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: class.c,v 1.4 1997/08/07 09:56:37 mdw Exp $
+ * $Id: class.c,v 1.5 1997/08/20 16:16:13 mdw Exp $
  *
  * Handling classes of things nicely
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------*
  *
  * $Log: class.c,v $
+ * Revision 1.5  1997/08/20 16:16:13  mdw
+ * Patch memory leak.  Don't try to trace when tracing's turned off.
+ *
  * Revision 1.4  1997/08/07 09:56:37  mdw
  * (Log entry for previous version is bogus.)  Minor changes to host
  * checking code.
@@ -156,6 +159,7 @@ void class_dec(classdef *c)
 {
   if (c != class_all && !--c->ref) {
     sym_destroyTable(c->t);
+    free(c->t);
     free(c);
   }
 }
@@ -313,6 +317,7 @@ int class_hostMatch(classdef *c, struct in_addr addr)
 
 void class_dump(classdef *c)
 {
+#ifdef TRACING
   sym_iter i;
   sym_base *s;
 
@@ -333,6 +338,7 @@ void class_dump(classdef *c)
   }
   else
     trace(TRACE_RULE, "    ALL");
+#endif
 }
 
 /*----- That's all, folks -------------------------------------------------*/