diff options
author | Ted Lemon <source@isc.org> | 1999-03-25 21:55:14 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 1999-03-25 21:55:14 +0000 |
commit | e7860b608e71c3543e289abbb08e2dce9d6052ca (patch) | |
tree | d804faab3854c41074c8d724f1785b89610dc5f4 /common/alloc.c | |
parent | ea2ee1fd843c10f46ea1ac54e9c702a69ee9742e (diff) | |
download | isc-dhcp-e7860b608e71c3543e289abbb08e2dce9d6052ca.tar.gz |
Add option allocator.
Diffstat (limited to 'common/alloc.c')
-rw-r--r-- | common/alloc.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/common/alloc.c b/common/alloc.c index 0a9dd629..46514a5c 100644 --- a/common/alloc.c +++ b/common/alloc.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: alloc.c,v 1.25 1999/03/16 05:50:31 mellon Exp $ Copyright (c) 1995, 1996, 1998 The Internet Software Consortium. All rights reserved.\n"; +"$Id: alloc.c,v 1.26 1999/03/25 21:55:14 mellon Exp $ Copyright (c) 1995, 1996, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -186,6 +186,28 @@ void free_name_server (ptr, name) dfree ((VOIDPTR)ptr, name); } +struct option *new_option (name) + char *name; +{ + struct option *rval = + dmalloc (sizeof (struct option), name); + if (rval) + memset (rval, 0, sizeof *rval); + return rval; +} + +void free_option (ptr, name) + struct option *ptr; + char *name; +{ +/* XXX have to put all options on heap before this is possible. */ +#if 0 + if (ptr -> name) + dfree ((VOIDPTR)option -> name, name); + dfree ((VOIDPTR)ptr, name); +#endif +} + void free_domain_search_list (ptr, name) struct domain_search_list *ptr; char *name; |