From bd14b60e924ebcdfcd5bc8e0655a33ae7c6332ce Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Fri, 1 Jan 2010 08:02:35 +0000 Subject: Two more calloc() wrapper wrappers, new_shared_network() and new_subnet(), bite the dust. --- usr.sbin/dhcpd/alloc.c | 17 +---------------- usr.sbin/dhcpd/confpars.c | 8 ++++---- usr.sbin/dhcpd/dhcpd.h | 4 +--- 3 files changed, 6 insertions(+), 23 deletions(-) (limited to 'usr.sbin') 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 *); -- cgit v1.2.3