diff --git a/CHANGES b/CHANGES index 6f9c8186fb..5a6e5aa2e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ + 350. [bug] Also-notify lists specified in the global options + block were not correctly reference counted, causing + a memory leak. + 344. [bug] When shutting down, lwresd sometimes tried to shut down its client tasks twice, triggering an assertion. diff --git a/lib/dns/config/confview.c b/lib/dns/config/confview.c index d06a57ced1..ebe189cac8 100644 --- a/lib/dns/config/confview.c +++ b/lib/dns/config/confview.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: confview.c,v 1.36 2000/06/09 22:13:23 brister Exp $ */ +/* $Id: confview.c,v 1.36.2.1 2000/07/25 22:47:37 gson Exp $ */ #include @@ -1052,10 +1052,12 @@ dns_c_view_getalsonotify(dns_c_view_t *view, { REQUIRE(DNS_C_VIEW_VALID(view)); REQUIRE(ipl != NULL); - - *ipl = view->also_notify; - return (*ipl == NULL ? ISC_R_NOTFOUND : ISC_R_SUCCESS); + if (view->also_notify == NULL) + return (ISC_R_NOTFOUND); + + dns_c_iplist_attach(view->also_notify, ipl); + return (ISC_R_SUCCESS); } diff --git a/lib/dns/config/confzone.c b/lib/dns/config/confzone.c index 057ff831ec..0ce89971be 100644 --- a/lib/dns/config/confzone.c +++ b/lib/dns/config/confzone.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: confzone.c,v 1.47 2000/06/05 09:17:09 brister Exp $ */ +/* $Id: confzone.c,v 1.47.2.1 2000/07/25 22:47:39 gson Exp $ */ #include @@ -1665,7 +1665,7 @@ dns_c_zone_getalsonotify(dns_c_zone_t *zone, dns_c_iplist_t **retval) { } if (p != NULL) { - *retval = p; + dns_c_iplist_attach(p, retval); res = ISC_R_SUCCESS; } else { res = ISC_R_NOTFOUND; diff --git a/lib/dns/zoneconf.c b/lib/dns/zoneconf.c index ab0702384b..b3bbcc580b 100644 --- a/lib/dns/zoneconf.c +++ b/lib/dns/zoneconf.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: zoneconf.c,v 1.43 2000/06/22 21:54:57 tale Exp $ */ +/* $Id: zoneconf.c,v 1.43.2.1 2000/07/25 22:47:35 gson Exp $ */ #include @@ -189,10 +189,14 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview, result = dns_c_view_getalsonotify(cview, &iplist); if (result != ISC_R_SUCCESS) result = dns_c_ctx_getalsonotify(cctx, &iplist); - if (result == ISC_R_SUCCESS) - RETERR(dns_zone_setalsonotify(zone, iplist->ips, - iplist->nextidx)); - else + if (result == ISC_R_SUCCESS) { + result = dns_zone_setalsonotify(zone, iplist->ips, + iplist->nextidx); + dns_c_iplist_detach(&iplist); + if (result != ISC_R_SUCCESS) + return (result); + + } else RETERR(dns_zone_setalsonotify(zone, NULL, 0)); RETERR(configure_zone_acl(czone, cctx, cview, ac, zone,