2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

408. [bug] stub zones could leak memory and refernce counts if

all the masters were unreachable.
This commit is contained in:
Mark Andrews
2000-08-25 04:42:49 +00:00
parent 6253eaa03c
commit ec4060d310
2 changed files with 13 additions and 5 deletions

View File

@@ -1,3 +1,5 @@
408. [bug] stub zones could leak memory and refernce counts if
all the masters were unreachable.
407. [bug] isc_rwlock_lock() would needlessly block
readers when it reached the read quota even

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.195 2000/08/22 19:32:47 gson Exp $ */
/* $Id: zone.c,v 1.196 2000/08/25 04:42:49 marka Exp $ */
#include <config.h>
@@ -2381,20 +2381,25 @@ stub_callback(isc_task_t *task, isc_event_t *event) {
isc_uint32_t nscnt, cnamecnt;
isc_result_t result;
isc_stdtime_t now;
isc_boolean_t exiting = ISC_FALSE;
stub = revent->ev_arg;
INSIST(DNS_STUB_VALID(stub));
UNUSED(task);
/* XXX add test for exiting */
dns_zone_iattach(stub->zone, &zone);
DNS_ENTER;
isc_stdtime_get(&now);
if (DNS_ZONE_FLAG(stub->zone, DNS_ZONEFLG_EXITING)) {
zone_log(zone, me, ISC_LOG_INFO, "exiting");
exiting = ISC_TRUE;
goto next_master;
}
isc_sockaddr_format(&zone->masteraddr, master, sizeof(master));
if (revent->result != ISC_R_SUCCESS) {
@@ -2508,12 +2513,12 @@ stub_callback(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
dns_request_destroy(&zone->request);
zone->curmaster++;
if (zone->curmaster >= zone->masterscnt) {
if (exiting || zone->curmaster >= zone->masterscnt) {
zone->flags &= ~DNS_ZONEFLG_REFRESH;
zone_settimer(zone, now);
UNLOCK(&zone->lock);
return;
goto free_stub;
}
UNLOCK(&zone->lock);
queue_soa_query(zone);
@@ -2537,6 +2542,7 @@ stub_callback(isc_task_t *task, isc_event_t *event) {
isc_mem_put(stub->mctx, stub, sizeof(*stub));
detach:
INSIST(event == NULL);
dns_zone_idetach(&zone);
return;
}