diff --git a/usr.sbin/config/hash.c b/usr.sbin/config/hash.c index ab367766c8d2..f4a338515429 100644 --- a/usr.sbin/config/hash.c +++ b/usr.sbin/config/hash.c @@ -1,4 +1,4 @@ -/* $NetBSD: hash.c,v 1.12 2003/11/24 21:44:37 christos Exp $ */ +/* $NetBSD: hash.c,v 1.13 2003/11/25 19:34:05 rafal Exp $ */ /* * Copyright (c) 1992, 1993 @@ -251,6 +251,8 @@ ht_remove(struct hashtab *ht, const char *name) if (hp->h_name != name) continue; TAILQ_REMOVE(hpp, hp, h_next); + + memset(hp, 0, sizeof(*hp)); TAILQ_INSERT_TAIL(&hefreelist, hp, h_next); ht->ht_used--; return (0); diff --git a/usr.sbin/config/util.c b/usr.sbin/config/util.c index c19c3863e271..2f3eac7e8057 100644 --- a/usr.sbin/config/util.c +++ b/usr.sbin/config/util.c @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.19 2003/11/24 21:44:37 christos Exp $ */ +/* $NetBSD: util.c,v 1.20 2003/11/25 19:34:06 rafal Exp $ */ /* * Copyright (c) 1992, 1993 @@ -223,6 +223,7 @@ void nvfree(struct nvlist *nv) { + memset(nv, 0, sizeof(*nv)); nv->nv_next = nvfreelist; nvfreelist = nv; } @@ -237,6 +238,7 @@ nvfreel(struct nvlist *nv) for (; nv != NULL; nv = next) { next = nv->nv_next; + memset(nv, 0, sizeof(*nv)); nv->nv_next = nvfreelist; nvfreelist = nv; }