Commit 4886701c authored by Mark Andrews's avatar Mark Andrews
Browse files

clear pointer before hash table

parent 161fec84
...@@ -93,6 +93,8 @@ isc_ht_destroy(isc_ht_t **htp) { ...@@ -93,6 +93,8 @@ isc_ht_destroy(isc_ht_t **htp) {
REQUIRE(htp != NULL); REQUIRE(htp != NULL);
ht = *htp; ht = *htp;
*htp = NULL;
REQUIRE(ISC_HT_VALID(ht)); REQUIRE(ISC_HT_VALID(ht));
ht->magic = 0; ht->magic = 0;
...@@ -114,7 +116,6 @@ isc_ht_destroy(isc_ht_t **htp) { ...@@ -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_put(ht->mctx, ht->table, ht->size * sizeof(isc_ht_node_t*));
isc_mem_putanddetach(&ht->mctx, ht, sizeof(struct isc_ht)); isc_mem_putanddetach(&ht->mctx, ht, sizeof(struct isc_ht));
*htp = NULL;
} }
isc_result_t isc_result_t
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment