]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
clear pointer before subtracting reference
authorMark Andrews <marka@isc.org>
Mon, 14 Sep 2020 01:02:33 +0000 (11:02 +1000)
committerMark Andrews <marka@isc.org>
Mon, 14 Sep 2020 01:02:33 +0000 (11:02 +1000)
lib/ns/tests/nstest.c

index bc421272aa7ade718307e159b45986fa46158d7c..769bac28fb44a176e22dd979e85d49f247343f68 100644 (file)
@@ -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;
 }