From: Michał Kępień Date: Mon, 29 Oct 2018 21:29:31 +0000 (+0100) Subject: Release all resources when shutting down an RPZ zone during an update X-Git-Tag: v9.13.4~74^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=139bc2c6abdadc584fb53becdb0a7885160afc0d;p=thirdparty%2Fbind9.git Release all resources when shutting down an RPZ zone during an update If an RPZ zone is to be freed during an update, canceling the update_quantum() event is not enough because the resources released when an update completes also need to be accounted for. Failure to do this results in a hang upon shutdown. Fix by copying cleanup code from the end of update_quantum() to rpz_detach(). --- diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index fa8b3d4491e..d861783e86d 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -2112,6 +2112,14 @@ rpz_detach(dns_rpz_zone_t **rpzp, dns_rpz_zones_t *rpzs) { } if (rpz->updaterunning) { isc_task_purgeevent(rpz->rpzs->updater, &rpz->updateevent); + if (rpz->updbit != NULL) { + dns_dbiterator_destroy(&rpz->updbit); + } + if (rpz->newnodes != NULL) { + isc_ht_destroy(&rpz->newnodes); + } + dns_db_closeversion(rpz->updb, &rpz->updbversion, false); + dns_db_detach(&rpz->updb); } isc_timer_reset(rpz->updatetimer, isc_timertype_inactive,