From: Mark Andrews Date: Mon, 14 Sep 2020 01:02:33 +0000 (+1000) Subject: clear pointer before subtracting reference X-Git-Tag: v9.17.6~63^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=baf165ffd0cb68020fdce57c894c48e715ad6ef5;p=thirdparty%2Fbind9.git clear pointer before subtracting reference --- diff --git a/lib/ns/tests/nstest.c b/lib/ns/tests/nstest.c index bc421272aa7..769bac28fb4 100644 --- a/lib/ns/tests/nstest.c +++ b/lib/ns/tests/nstest.c @@ -107,6 +107,8 @@ __wrap_isc_nmhandle_detach(isc_nmhandle_t **handlep) { ns_client_t *client = (ns_client_t *)handle; int i; + *handlep = NULL; + for (i = 0; i < 32; i++) { if (atomic_load(&client_addrs[i]) == (uintptr_t)client) { break; @@ -122,7 +124,6 @@ __wrap_isc_nmhandle_detach(isc_nmhandle_t **handlep) { isc_mem_put(mctx, client, sizeof(ns_client_t)); } - *handlep = NULL; return; }