From: Ted Lemon Date: Thu, 14 Sep 2000 11:29:43 +0000 (+0000) Subject: Don't dereference zones in find_tsig_key - we don't hold a reference! X-Git-Tag: V3-BETA-2-PATCH-4~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=491e71bcad761ad0db350697a02a6b7dea35e4a8;p=thirdparty%2Fdhcp.git Don't dereference zones in find_tsig_key - we don't hold a reference! --- diff --git a/common/dns.c b/common/dns.c index 31800bfc2..a7d808abf 100644 --- a/common/dns.c +++ b/common/dns.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: dns.c,v 1.27 2000/08/03 20:59:34 neild Exp $ Copyright (c) 2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dns.c,v 1.28 2000/09/14 11:29:43 mellon Exp $ Copyright (c) 2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -138,19 +138,11 @@ isc_result_t find_tsig_key (ns_tsig_key **key, const char *zname, { isc_result_t status; ns_tsig_key *tkey; -#if 0 - struct dns_zone *zone; - zone = (struct dns_zone *)0; - status = dns_zone_lookup (&zone, zname); - if (status != ISC_R_SUCCESS) - return status; -#else if (!zone) return ISC_R_NOTFOUND; -#endif + if (!zone -> key) { - dns_zone_dereference (&zone, MDL); return ISC_R_KEY_UNKNOWN; } @@ -159,13 +151,11 @@ isc_result_t find_tsig_key (ns_tsig_key **key, const char *zname, (!zone -> key -> algorithm || strlen (zone -> key -> algorithm) > NS_MAXDNAME) || (!zone -> key)) { - dns_zone_dereference (&zone, MDL); return ISC_R_INVALIDKEY; } tkey = dmalloc (sizeof *tkey, MDL); if (!tkey) { nomem: - dns_zone_dereference (&zone, MDL); return ISC_R_NOMEMORY; } memset (tkey, 0, sizeof *tkey);