From 08ed0f97a1be10de9a763ff89f716c65731e5ee0 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Nov 2012 11:16:28 +1100 Subject: [PATCH] 3419. [bug] Memory leak on validation cancel. [RT #31869] Squashed commit of the following: commit 452b07ec7cb31784d90d9c2e45ca708df306302e Author: Mark Andrews Date: Wed Nov 14 23:36:36 2012 +1100 destroy fetch when canceling validator --- CHANGES | 2 ++ lib/dns/validator.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index fa6d9b6432..fc933a79bc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3419. [bug] Memory leak on validation cancel. [RT #31869] + 3417. [func] Optional new XML schema (version 3.0) for the statistics channel adds query type statistics at the zone level, and flattens the XML tree and uses diff --git a/lib/dns/validator.c b/lib/dns/validator.c index f5b84dde1e..f65f8fff1e 100644 --- a/lib/dns/validator.c +++ b/lib/dns/validator.c @@ -4278,9 +4278,11 @@ dns_validator_cancel(dns_validator_t *validator) { } UNLOCK(&validator->lock); - /* Need to cancel fetch outside validator lock */ - if (fetch != NULL) + /* Need to cancel and destroy the fetch outside validator lock */ + if (fetch != NULL) { dns_resolver_cancelfetch(fetch); + dns_resolver_destroyfetch(&fetch); + } } static void