]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Fix a bunch of problems in calling clone_grpup.
authorTed Lemon <source@isc.org>
Mon, 12 Jun 2000 20:14:16 +0000 (20:14 +0000)
committerTed Lemon <source@isc.org>
Mon, 12 Jun 2000 20:14:16 +0000 (20:14 +0000)
server/confpars.c

index 9580718dcda390b69b39d431b46559e9d558bc08..503b570fba55855e4fb855593a5129e30a5fbb4f 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: confpars.c,v 1.116 2000/06/08 21:20:00 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: confpars.c,v 1.117 2000/06/12 20:14:16 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -313,9 +313,7 @@ int parse_statement (cfile, group, type, host_decl, declaration)
                        log_fatal ("Can't allocate shared subnet: %s",
                                   isc_result_totext (status));
                if (!clone_group (&share -> group, group, MDL))
-                       log_fatal ("Can't allocate group for shared subnet.");
-               shared_network_reference (&share -> group -> shared_network,
-                                         share, MDL);
+                       log_fatal ("Can't allocate group for shared net");
 
                parse_subnet_declaration (cfile, share);
 
@@ -1072,7 +1070,8 @@ void parse_pool_statement (cfile, group, type)
        if (status != ISC_R_SUCCESS)
                log_fatal ("no memory for pool.");
 
-       clone_group (&pool -> group, group, MDL);
+       if (!clone_group (&pool -> group, group, MDL))
+               log_fatal ("can't clone pool group");
 
        if (type == SUBNET_DECL)
                shared_network_reference (&pool -> shared_network,
@@ -1369,9 +1368,8 @@ void parse_host_declaration (cfile, group)
                log_fatal ("can't allocate host decl struct %s: %s",
                           name, isc_result_totext (status));
        host -> name = name;
-       if (clone_group (&host -> group, group, MDL) != ISC_R_SUCCESS) {
-               log_fatal ("can't clone group for host %s: %s",
-                          name, isc_result_totext (status));
+       if (!clone_group (&host -> group, group, MDL)) {
+               log_fatal ("can't clone group for host %s", name);
              boom:
                host_dereference (&host, MDL);
                return;
@@ -1708,7 +1706,9 @@ int parse_class_declaration (cp, cfile, group, type)
                        return cp ? (status == ISC_R_SUCCESS) : 1;
                }
                /* Give the subclass its own group. */
-               clone_group (&class -> group, class -> group, MDL);
+               if (!clone_group (&class -> group, class -> group, MDL))
+                       log_fatal ("can't clone class group.");
+
        }
 
        if (!parse_lbrace (cfile)) {