From 3ca17e24f33b3c9ffe417fc2608616d4cb44d61a Mon Sep 17 00:00:00 2001 From: lukem Date: Mon, 25 Jan 1999 00:33:36 +0000 Subject: [PATCH] * change default classes from "IN,HS" to "HS" (for backwards compat with older hesiod.conf files & parsers) * check list != NULL in hesiod_free_list() * hes_free() is now just a wrapper to hesiod_free_list() --- lib/libc/net/hesiod.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/libc/net/hesiod.c b/lib/libc/net/hesiod.c index f1f92cf6ae7c..f7e50016e7c8 100644 --- a/lib/libc/net/hesiod.c +++ b/lib/libc/net/hesiod.c @@ -1,4 +1,4 @@ -/* $NetBSD: hesiod.c,v 1.6 1999/01/25 00:17:55 lukem Exp $ */ +/* $NetBSD: hesiod.c,v 1.7 1999/01/25 00:33:36 lukem Exp $ */ /* Copyright (c) 1996 by Internet Software Consortium. * @@ -52,7 +52,7 @@ __IDSTRING(rcsid_hesiod_p_h, "#Id: hesiod_p.h,v 1.1 1996/12/08 21:39:37 ghudson Exp #"); __IDSTRING(rcsid_hescompat_c, "#Id: hescompat.c,v 1.1.2.1 1996/12/16 08:37:45 ghudson Exp #"); -__RCSID("$NetBSD: hesiod.c,v 1.6 1999/01/25 00:17:55 lukem Exp $"); +__RCSID("$NetBSD: hesiod.c,v 1.7 1999/01/25 00:33:36 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -266,6 +266,8 @@ hesiod_free_list(context, list) { char **p; + if (list == NULL) + return; for (p = list; *p; p++) free(*p); free(list); @@ -288,8 +290,8 @@ read_config_file(ctx, filename) FILE *fp; /* Set default query classes. */ - ctx->classes[0] = C_IN; - ctx->classes[1] = C_HS; + ctx->classes[0] = C_HS; + ctx->classes[1] = 0; /* Try to open the configuration file. */ fp = fopen(filename, "r"); @@ -552,12 +554,7 @@ void hes_free(hp) char **hp; { - int i; - if (!hp) - return; - for (i = 0; hp[i]; i++) - free(hp[i]); - free(hp); + hesiod_free_list(context, hp); } static int