From: Ted Lemon Date: Mon, 12 Jun 2000 20:14:16 +0000 (+0000) Subject: Fix a bunch of problems in calling clone_grpup. X-Git-Tag: V3-BETA-2-PATCH-1~153 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f84d544bb3a2cce258f38d7ad86244e498e7cd49;p=thirdparty%2Fdhcp.git Fix a bunch of problems in calling clone_grpup. --- diff --git a/server/confpars.c b/server/confpars.c index 9580718dc..503b570fb 100644 --- a/server/confpars.c +++ b/server/confpars.c @@ -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)) {