2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

2898. [bug] nslookup leaked memory when -domain=value was

specified. [RT #21301]
This commit is contained in:
Mark Andrews 2010-05-18 01:48:13 +00:00
parent 8d31dd9ab6
commit 98744b5111
2 changed files with 15 additions and 12 deletions

View File

@ -1,3 +1,6 @@
2898. [bug] nslookup leaked memory when -domain=value was
specified. [RT #21301]
2897. [bug] NSEC3 chains could be left behind when transitioning 2897. [bug] NSEC3 chains could be left behind when transitioning
to insecure. [RT #21040] to insecure. [RT #21040]

View File

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dighost.c,v 1.328 2009/11/10 17:27:40 each Exp $ */ /* $Id: dighost.c,v 1.329 2010/05/18 01:48:13 marka Exp $ */
/*! \file /*! \file
* \note * \note
@ -1161,13 +1161,22 @@ make_searchlist_entry(char *domain) {
return (search); return (search);
} }
static void
clear_searchlist(void) {
dig_searchlist_t *search;
while ((search = ISC_LIST_HEAD(search_list)) != NULL) {
ISC_LIST_UNLINK(search_list, search, link);
isc_mem_free(mctx, search);
}
}
static void static void
create_search_list(lwres_conf_t *confdata) { create_search_list(lwres_conf_t *confdata) {
int i; int i;
dig_searchlist_t *search; dig_searchlist_t *search;
debug("create_search_list()"); debug("create_search_list()");
ISC_LIST_INIT(search_list); clear_searchlist();
for (i = 0; i < confdata->searchnxt; i++) { for (i = 0; i < confdata->searchnxt; i++) {
search = make_searchlist_entry(confdata->search[i]); search = make_searchlist_entry(confdata->search[i]);
@ -1210,7 +1219,7 @@ setup_system(void) {
else { /* No search list. Use the domain name if any */ else { /* No search list. Use the domain name if any */
if (lwconf->domainname != NULL) { if (lwconf->domainname != NULL) {
domain = make_searchlist_entry(lwconf->domainname); domain = make_searchlist_entry(lwconf->domainname);
ISC_LIST_INITANDAPPEND(search_list, domain, link); ISC_LIST_APPEND(search_list, domain, link);
domain = NULL; domain = NULL;
} }
} }
@ -1265,15 +1274,6 @@ setup_system(void) {
} }
static void
clear_searchlist(void) {
dig_searchlist_t *search;
while ((search = ISC_LIST_HEAD(search_list)) != NULL) {
ISC_LIST_UNLINK(search_list, search, link);
isc_mem_free(mctx, search);
}
}
/*% /*%
* Override the search list derived from resolv.conf by 'domain'. * Override the search list derived from resolv.conf by 'domain'.
*/ */