diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-01-01 08:02:35 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-01-01 08:02:35 +0000 |
commit | bd14b60e924ebcdfcd5bc8e0655a33ae7c6332ce (patch) | |
tree | 8691d6d53f92d98b79c65c442a4940f7a8aa3f7a /usr.sbin | |
parent | f197a60c615a3d784e1f75b9c78997bc444fe47c (diff) |
Two more calloc() wrapper wrappers, new_shared_network() and
new_subnet(), bite the dust.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/dhcpd/alloc.c | 17 | ||||
-rw-r--r-- | usr.sbin/dhcpd/confpars.c | 8 | ||||
-rw-r--r-- | usr.sbin/dhcpd/dhcpd.h | 4 |
3 files changed, 6 insertions, 23 deletions
diff --git a/usr.sbin/dhcpd/alloc.c b/usr.sbin/dhcpd/alloc.c index efa7d2a74f4..a9e31dc4c1e 100644 --- a/usr.sbin/dhcpd/alloc.c +++ b/usr.sbin/dhcpd/alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alloc.c,v 1.6 2010/01/01 06:25:37 krw Exp $ */ +/* $OpenBSD: alloc.c,v 1.7 2010/01/01 08:02:34 krw Exp $ */ /* Memory allocation... */ @@ -123,21 +123,6 @@ free_tree(struct tree *ptr, char *name) dfree(ptr, name); } -struct shared_network * -new_shared_network(char *name) -{ - struct shared_network *rval = - dmalloc(sizeof(struct shared_network), name); - return (rval); -} - -struct subnet * -new_subnet(char *name) -{ - struct subnet *rval = dmalloc(sizeof(struct subnet), name); - return (rval); -} - struct lease_state * new_lease_state(char *name) { diff --git a/usr.sbin/dhcpd/confpars.c b/usr.sbin/dhcpd/confpars.c index 9436953f3d1..98ad39c3ae3 100644 --- a/usr.sbin/dhcpd/confpars.c +++ b/usr.sbin/dhcpd/confpars.c @@ -1,4 +1,4 @@ -/* $OpenBSD: confpars.c,v 1.16 2006/12/17 18:03:33 stevesk Exp $ */ +/* $OpenBSD: confpars.c,v 1.17 2010/01/01 08:02:34 krw Exp $ */ /* * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. @@ -232,7 +232,7 @@ int parse_statement(cfile, group, type, host_decl, declaration) /* Otherwise, cons up a fake shared network structure and populate it with the lone subnet... */ - share = new_shared_network("parse_statement"); + share = calloc(1, sizeof(struct shared_network)); if (!share) error("No memory for shared subnet"); share->group = clone_group(group, "parse_statement:subnet"); @@ -618,7 +618,7 @@ void parse_shared_net_declaration(cfile, group) char *name; int declaration = 0; - share = new_shared_network("parse_shared_net_declaration"); + share = calloc(1, sizeof(struct shared_network)); if (!share) error("No memory for shared subnet"); share->leases = NULL; @@ -688,7 +688,7 @@ void parse_subnet_declaration(cfile, share) int len = sizeof addr; int declaration = 0; - subnet = new_subnet("parse_subnet_declaration"); + subnet = calloc(1, sizeof(struct subnet)); if (!subnet) error("No memory for new subnet"); subnet->shared_network = share; diff --git a/usr.sbin/dhcpd/dhcpd.h b/usr.sbin/dhcpd/dhcpd.h index 9454462ef99..0eabebe98d6 100644 --- a/usr.sbin/dhcpd/dhcpd.h +++ b/usr.sbin/dhcpd/dhcpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpd.h,v 1.39 2010/01/01 06:25:37 krw Exp $ */ +/* $OpenBSD: dhcpd.h,v 1.40 2010/01/01 08:02:34 krw Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998, 1999 @@ -607,8 +607,6 @@ void dfree(void *, char *); struct tree *new_tree(char *); struct tree_cache *new_tree_cache(char *); struct hash_table *new_hash_table(int, char *); -struct subnet *new_subnet(char *); -struct shared_network *new_shared_network(char *); struct lease_state *new_lease_state(char *); void free_lease_state(struct lease_state *, char *); void free_lease(struct lease *, char *); |