]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
clear pointer before hash table
authorMark Andrews <marka@isc.org>
Mon, 29 Apr 2019 23:44:12 +0000 (09:44 +1000)
committerMark Andrews <marka@isc.org>
Tue, 7 May 2019 00:37:37 +0000 (10:37 +1000)
lib/isc/ht.c

index efd689dcfa1b333390a52b99a2f916c56b5e495a..e8e3eb12d55b1cf0adedf3786cb8fb8708afb39a 100644 (file)
@@ -93,6 +93,8 @@ isc_ht_destroy(isc_ht_t **htp) {
        REQUIRE(htp != NULL);
 
        ht = *htp;
+       *htp = NULL;
+
        REQUIRE(ISC_HT_VALID(ht));
 
        ht->magic = 0;
@@ -114,7 +116,6 @@ isc_ht_destroy(isc_ht_t **htp) {
        isc_mem_put(ht->mctx, ht->table, ht->size * sizeof(isc_ht_node_t*));
        isc_mem_putanddetach(&ht->mctx, ht, sizeof(struct isc_ht));
 
-       *htp = NULL;
 }
 
 isc_result_t