mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
1936. [bug] The validator could leak memory. [RT #5544]
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: validator.c,v 1.133 2005/10/14 01:14:09 marka Exp $ */
|
||||
/* $Id: validator.c,v 1.134 2005/11/02 01:46:31 marka Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
@@ -228,6 +228,13 @@ fetch_callback_validator(isc_task_t *task, isc_event_t *event) {
|
||||
rdataset = &val->frdataset;
|
||||
eresult = devent->result;
|
||||
|
||||
/* Free resources which are not of interest. */
|
||||
if (devent->node != NULL)
|
||||
dns_db_detachnode(devent->db, &devent->node);
|
||||
if (devent->db != NULL)
|
||||
dns_db_detach(&devent->db);
|
||||
if (dns_rdataset_isassociated(&val->fsigrdataset))
|
||||
dns_rdataset_disassociate(&val->fsigrdataset);
|
||||
isc_event_free(&event);
|
||||
dns_resolver_destroyfetch(&val->fetch);
|
||||
|
||||
@@ -280,6 +287,13 @@ dsfetched(isc_task_t *task, isc_event_t *event) {
|
||||
rdataset = &val->frdataset;
|
||||
eresult = devent->result;
|
||||
|
||||
/* Free resources which are not of interest. */
|
||||
if (devent->node != NULL)
|
||||
dns_db_detachnode(devent->db, &devent->node);
|
||||
if (devent->db != NULL)
|
||||
dns_db_detach(&devent->db);
|
||||
if (dns_rdataset_isassociated(&val->fsigrdataset))
|
||||
dns_rdataset_disassociate(&val->fsigrdataset);
|
||||
isc_event_free(&event);
|
||||
dns_resolver_destroyfetch(&val->fetch);
|
||||
|
||||
@@ -336,6 +350,13 @@ dsfetched2(isc_task_t *task, isc_event_t *event) {
|
||||
val = devent->ev_arg;
|
||||
eresult = devent->result;
|
||||
|
||||
/* Free resources which are not of interest. */
|
||||
if (devent->node != NULL)
|
||||
dns_db_detachnode(devent->db, &devent->node);
|
||||
if (devent->db != NULL)
|
||||
dns_db_detach(&devent->db);
|
||||
if (dns_rdataset_isassociated(&val->fsigrdataset))
|
||||
dns_rdataset_disassociate(&val->fsigrdataset);
|
||||
dns_resolver_destroyfetch(&val->fetch);
|
||||
|
||||
INSIST(val->event != NULL);
|
||||
@@ -2030,6 +2051,13 @@ dlvfetched(isc_task_t *task, isc_event_t *event) {
|
||||
val = devent->ev_arg;
|
||||
eresult = devent->result;
|
||||
|
||||
/* Free resources which are not of interest. */
|
||||
if (devent->node != NULL)
|
||||
dns_db_detachnode(devent->db, &devent->node);
|
||||
if (devent->db != NULL)
|
||||
dns_db_detach(&devent->db);
|
||||
if (dns_rdataset_isassociated(&val->fsigrdataset))
|
||||
dns_rdataset_disassociate(&val->fsigrdataset);
|
||||
isc_event_free(&event);
|
||||
dns_resolver_destroyfetch(&val->fetch);
|
||||
|
||||
@@ -2664,6 +2692,10 @@ destroy(dns_validator_t *val) {
|
||||
dns_validator_destroy(&val->subvalidator);
|
||||
if (val->havedlvsep)
|
||||
dns_rdataset_disassociate(&val->dlv);
|
||||
if (dns_rdataset_isassociated(&val->frdataset))
|
||||
dns_rdataset_disassociate(&val->frdataset);
|
||||
if (dns_rdataset_isassociated(&val->fsigrdataset))
|
||||
dns_rdataset_disassociate(&val->fsigrdataset);
|
||||
mctx = val->view->mctx;
|
||||
if (val->siginfo != NULL)
|
||||
isc_mem_put(mctx, val->siginfo, sizeof(*val->siginfo));
|
||||
|
Reference in New Issue
Block a user