From: Mark Andrews Date: Mon, 29 Apr 2019 23:44:12 +0000 (+1000) Subject: clear pointer before hash table X-Git-Tag: v9.15.0~14^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4886701c0389b2f4b35364c2634e0b5b4a12eaa2;p=thirdparty%2Fbind9.git clear pointer before hash table --- diff --git a/lib/isc/ht.c b/lib/isc/ht.c index efd689dcfa1..e8e3eb12d55 100644 --- a/lib/isc/ht.c +++ b/lib/isc/ht.c @@ -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