From daf99720c90d7f527a12e76e437ae8c95fdf84ca Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Tue, 14 Nov 2000 18:14:44 +0000 Subject: [PATCH] the existence of a dynamically allocated array for the NXT bits should not depend on its length --- lib/dns/rdata/generic/nxt_30.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/dns/rdata/generic/nxt_30.c b/lib/dns/rdata/generic/nxt_30.c index 2b9ad4a686..b5743922fa 100644 --- a/lib/dns/rdata/generic/nxt_30.c +++ b/lib/dns/rdata/generic/nxt_30.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nxt_30.c,v 1.42 2000/11/08 01:55:53 bwelling Exp $ */ +/* $Id: nxt_30.c,v 1.43 2000/11/14 18:14:44 gson Exp $ */ /* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */ @@ -201,8 +201,7 @@ fromstruct_nxt(ARGS_FROMSTRUCT) { REQUIRE(source != NULL); REQUIRE(nxt->common.rdtype == type); REQUIRE(nxt->common.rdclass == rdclass); - REQUIRE((nxt->typebits != NULL && nxt->len != 0) || - (nxt->typebits == NULL && nxt->len == 0)); + REQUIRE(nxt->typebits != NULL || nxt->len == 0); dns_name_toregion(&nxt->next, ®ion); RETERR(isc_buffer_copyregion(target, ®ion)); @@ -232,12 +231,9 @@ tostruct_nxt(ARGS_TOSTRUCT) { RETERR(name_duporclone(&name, mctx, &nxt->next)); nxt->len = region.length; - if (nxt->len != 0) { - nxt->typebits = mem_maybedup(mctx, region.base, region.length); - if (nxt->typebits == NULL) - goto cleanup; - } else - nxt->typebits = NULL; + nxt->typebits = mem_maybedup(mctx, region.base, region.length); + if (nxt->typebits == NULL) + goto cleanup; nxt->mctx = mctx; return (ISC_R_SUCCESS);