]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Release old billing class when parsing new billing class.
authorTed Lemon <source@isc.org>
Fri, 6 Apr 2001 05:52:19 +0000 (05:52 +0000)
committerTed Lemon <source@isc.org>
Fri, 6 Apr 2001 05:52:19 +0000 (05:52 +0000)
server/confpars.c

index 006f8911ec58fa4ec3dfe7a28ddc7c5b65d1bdb7..7e76d7540042e4d7f40f9e861f72d38fba5dac52 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: confpars.c,v 1.137 2001/03/17 02:02:20 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: confpars.c,v 1.138 2001/04/06 05:52:19 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -2635,6 +2635,9 @@ int parse_lease_declaration (struct lease **lp, struct parse *cfile)
                                        token = BILLING;
                                        break;
                                }
+                               if (lease -> billing_class)
+                                       unbill_class (lease,
+                                                     lease -> billing_class);
                                find_class (&lease -> billing_class, val, MDL);
                                if (!lease -> billing_class)
                                        parse_warn (cfile,
@@ -2642,8 +2645,8 @@ int parse_lease_declaration (struct lease **lp, struct parse *cfile)
                                parse_semi (cfile);
                        } else if (token == SUBCLASS) {
                                if (lease -> billing_class)
-                                       class_dereference
-                                               (&lease -> billing_class, MDL);
+                                       unbill_class (lease,
+                                                     lease -> billing_class);
                                parse_class_declaration
                                        (&lease -> billing_class,
                                         cfile, (struct group *)0, 3);