diff options
Diffstat (limited to 'contrib/bind/lib/irs/gen_ng.c')
-rw-r--r-- | contrib/bind/lib/irs/gen_ng.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/contrib/bind/lib/irs/gen_ng.c b/contrib/bind/lib/irs/gen_ng.c index 3958380cbbb98..064d61647508b 100644 --- a/contrib/bind/lib/irs/gen_ng.c +++ b/contrib/bind/lib/irs/gen_ng.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996 by Internet Software Consortium. + * Copyright (c) 1996,1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static char rcsid[] = "$Id: gen_ng.c,v 1.9 1997/12/04 04:57:50 halley Exp $"; +static const char rcsid[] = "$Id: gen_ng.c,v 1.14 1999/10/13 16:39:29 vixie Exp $"; #endif /* Imports */ @@ -25,10 +25,15 @@ static char rcsid[] = "$Id: gen_ng.c,v 1.9 1997/12/04 04:57:50 halley Exp $"; #include <sys/types.h> +#include <netinet/in.h> +#include <arpa/nameser.h> +#include <resolv.h> + #include <errno.h> #include <stdlib.h> #include <string.h> +#include <isc/memcluster.h> #include <irs.h> #include "port_after.h" @@ -62,13 +67,13 @@ irs_gen_ng(struct irs_acc *this) { struct irs_ng *ng; struct pvt *pvt; - if (!(ng = malloc(sizeof *ng))) { + if (!(ng = memget(sizeof *ng))) { errno = ENOMEM; return (NULL); } memset(ng, 0x5e, sizeof *ng); - if (!(pvt = malloc(sizeof *pvt))) { - free(ng); + if (!(pvt = memget(sizeof *pvt))) { + memput(ng, sizeof *ng); errno = ENOMEM; return (NULL); } @@ -90,10 +95,11 @@ static void ng_close(struct irs_ng *this) { struct pvt *pvt = (struct pvt *)this->private; + ng_minimize(this); if (pvt->curgroup) free(pvt->curgroup); - free(pvt); - free(this); + memput(pvt, sizeof *pvt); + memput(this, sizeof *this); } static int |