Commit 90a64829 authored by Mark Andrews's avatar Mark Andrews

Merge branch '983-delv-www-isc-org-any-rtrace-multiline-leaks-memory-v9_11' into 'v9_11'

Resolve "'delv www.isc.org ANY +rtrace +multiline' leaks memory"

See merge request isc-projects/bind9!1897
parents 405738b6 eef0430b
Pipeline #14097 passed with stages
in 3 minutes
5222. [bug] 'delve -t ANY' could leak memory. [GL #983]
5218. [bug] Conditionally include <dlfcn.h>. [GL #995]
5214. [bug] win32: named now removes its lock file upon shutdown.
......
......@@ -517,7 +517,7 @@ else
fi
# using delv insecure mode as not testing dnssec here
DELVOPTS="-i -p ${PORT}"
DELVOPTS="+noroot +nodlv -p ${PORT}"
if [ -x ${DELV} ] ; then
n=`expr $n + 1`
......@@ -721,13 +721,23 @@ if [ -x ${DELV} ] ; then
n=`expr $n + 1`
echo_i "check that delv -q -m works ($n)"
ret=0
$DELV $DELVOPTS @10.53.0.3 -q -m > delv.out.test$n 2>&1
$DELV $DELVOPTS @10.53.0.3 -q -m > delv.out.test$n 2>&1 || ret=1
grep '^; -m\..*[0-9]*.*IN.*ANY.*;' delv.out.test$n > /dev/null || ret=1
grep "^add " delv.out.test$n > /dev/null && ret=1
grep "^del " delv.out.test$n > /dev/null && ret=1
check_ttl_range delv.out.test$n '\\-ANY' 300 3 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that delv -t ANY works ($n)"
ret=0
$DELV $DELVOPTS @10.53.0.3 -t ANY example > delv.out.test$n 2>&1 || ret=1
grep "^example." < delv.out.test$n > /dev/null || ret=1
check_ttl_range delv.out.test$n NS 300 || ret=1
check_ttl_range delv.out.test$n SOA 300 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
else
echo_i "$DELV is needed, so skipping these delv tests"
fi
......
......@@ -125,10 +125,10 @@ typedef struct resctx {
unsigned int magic;
isc_mutex_t lock;
dns_client_t *client;
bool want_dnssec;
bool want_validation;
bool want_cdflag;
bool want_tcp;
bool want_dnssec;
bool want_validation;
bool want_cdflag;
bool want_tcp;
/* Locked */
ISC_LINK(struct resctx) link;
......@@ -141,7 +141,7 @@ typedef struct resctx {
dns_namelist_t namelist;
isc_result_t result;
dns_clientresevent_t *event;
bool canceled;
bool canceled;
dns_rdataset_t *rdataset;
dns_rdataset_t *sigrdataset;
} resctx_t;
......@@ -160,7 +160,7 @@ typedef struct resarg {
isc_result_t vresult;
dns_namelist_t *namelist;
dns_clientrestrans_t *trans;
bool canceled;
bool canceled;
} resarg_t;
/*%
......@@ -175,7 +175,7 @@ typedef struct reqctx {
/* Locked */
ISC_LINK(struct reqctx) link;
bool canceled;
bool canceled;
dns_tsigkey_t *tsigkey;
dns_request_t *request;
dns_clientreqevent_t *event;
......@@ -193,7 +193,7 @@ typedef struct reqarg {
/* Locked */
isc_result_t result;
dns_clientreqtrans_t *trans;
bool canceled;
bool canceled;
} reqarg_t;
/*%
......@@ -208,7 +208,7 @@ typedef struct updatearg {
/* Locked */
isc_result_t result;
dns_clientupdatetrans_t *trans;
bool canceled;
bool canceled;
} updatearg_t;
/*%
......@@ -219,14 +219,14 @@ typedef struct updatectx {
unsigned int magic;
isc_mutex_t lock;
dns_client_t *client;
bool want_tcp;
bool want_tcp;
/* Locked */
dns_request_t *updatereq;
dns_request_t *soareq;
dns_clientrestrans_t *restrans;
dns_clientrestrans_t *restrans2;
bool canceled;
bool canceled;
/* Task Locked */
ISC_LINK(struct updatectx) link;
......@@ -1111,6 +1111,12 @@ client_resfind(resctx_t *rctx, dns_fetchevent_t *event) {
}
}
}
if (rctx->rdataset != NULL) {
putrdataset(mctx, &rctx->rdataset);
}
if (rctx->sigrdataset != NULL) {
putrdataset(mctx, &rctx->sigrdataset);
}
if (n == 0) {
/*
* We didn't match any rdatasets (which means
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment