- Fix crash after reload where a stats lookup could reference old key

cache and neg cache structures.
This commit is contained in:
W.C.A. Wijngaards 2020-01-14 15:18:52 +01:00
parent 9b3f3101e3
commit 2c4be0c201
3 changed files with 18 additions and 12 deletions

View file

@ -3,6 +3,8 @@
because dnscrypt-proxy (2.0.36) does not support the test setup
any more, and also the config file format does not seem to have
the appropriate keys to recreate that setup.
- Fix crash after reload where a stats lookup could reference old key
cache and neg cache structures.
10 January 2020: Wouter
- Fix the relationship between serve-expired and prefetch options,

View file

@ -25,7 +25,7 @@ if grep "10.20.30.40" outfile; then
echo "OK"
else
echo "> cat logfiles"
cat fwd.log
cat fwd.log
cat unbound.log
echo "Not OK"
exit 1
@ -37,7 +37,7 @@ $PRE/unbound-control -c ub.conf blablargh
if test $? -ne 1; then
echo "wrong exit value on error."
echo "> cat logfiles"
cat fwd.log
cat fwd.log
cat unbound.log
exit 1
else
@ -61,7 +61,7 @@ if grep "5.6.7.8" outfile; then
echo "OK"
else
echo "> cat logfiles"
cat fwd.log
cat fwd.log
cat unbound.log
echo "Not OK"
exit 1
@ -72,6 +72,8 @@ echo "$PRE/unbound-control -c ub.conf stats"
$PRE/unbound-control -c ub.conf stats > tmp.$$
if test $? -ne 0; then
echo "wrong exit value after success"
cat fwd.log
cat unbound.log
exit 1
fi
if grep "^total.num.queries=[1-9][0-9]*$" tmp.$$; then
@ -90,7 +92,7 @@ if test $? -ne 0; then
exit 1
fi
# check syntax error in parse
# check syntax error in parse
echo "$PRE/unbound-control -c ub.conf verbosity jkdf"
$PRE/unbound-control -c ub.conf verbosity jkdf
if test $? -ne 1; then
@ -135,7 +137,7 @@ if grep "192.0.2.1" outfile; then
echo "OK"
else
echo "> cat logfiles"
cat fwd.log
cat fwd.log
cat unbound.log
echo "Not OK"
exit 1
@ -149,7 +151,7 @@ if grep "NXDOMAIN" outfile; then
echo "OK"
else
echo "> cat logfiles"
cat fwd.log
cat fwd.log
cat unbound.log
echo "Not OK"
exit 1
@ -169,7 +171,7 @@ if grep "NXDOMAIN" outfile; then
echo "OK"
else
echo "> cat logfiles"
cat fwd.log
cat fwd.log
cat unbound.log
echo "Not OK"
exit 1
@ -189,7 +191,7 @@ if grep "SERVFAIL" outfile; then
echo "OK"
else
echo "> cat logfiles"
cat fwd.log
cat fwd.log
cat unbound.log
echo "Not OK"
exit 1
@ -216,7 +218,7 @@ else
exit 1
fi
# test lookup
# test lookup
echo "$PRE/unbound-control -c ub.conf lookup www.example.com"
$PRE/unbound-control -c ub.conf lookup www.example.com
if test $? -ne 0; then
@ -282,7 +284,7 @@ done
if kill -0 $UNBOUND_PID; then
echo "still up!"
echo "> cat logfiles"
cat fwd.log
cat fwd.log
cat unbound.log
echo "not stopped, failure"
exit 1
@ -294,7 +296,7 @@ else
echo "lock-verify test worked."
else
echo "lock-verify test failed."
cat fwd.log
cat fwd.log
cat unbound.log
exit 1
fi
@ -302,7 +304,7 @@ else
fi
echo "> cat logfiles"
cat fwd.log
cat fwd.log
cat unbound.log
echo "> OK"
exit 0

View file

@ -200,7 +200,9 @@ val_deinit(struct module_env* env, int id)
anchors_delete(env->anchors);
env->anchors = NULL;
key_cache_delete(val_env->kcache);
env->key_cache = NULL;
neg_cache_delete(val_env->neg_cache);
env->neg_cache = NULL;
free(val_env->nsec3_keysize);
free(val_env->nsec3_maxiter);
free(val_env);