Skip to content
Snippets Groups Projects
Commit 97cd807d authored by Lubos Slovak's avatar Lubos Slovak
Browse files

Fix in zone_deep_free()

- Was trying to free the hashtable even if there was none.
parent f14c1621
No related branches found
No related tags found
No related merge requests found
......@@ -609,7 +609,9 @@ void dnslib_zone_deep_free(dnslib_zone_t **zone)
return;
}
ck_destroy_table(&(*zone)->table, NULL, 0);
if ((*zone)->table != NULL) {
ck_destroy_table(&(*zone)->table, NULL, 0);
}
/* has to go through zone twice, rdata may contain references to node
owners earlier in the zone which may be already freed */
......
......@@ -634,6 +634,8 @@ ck_hash_table_t *ck_create_table(uint items)
void ck_destroy_table(ck_hash_table_t **table, void (*dtor_value)(void *value),
int delete_key)
{
assert(table);
assert(*table);
pthread_mutex_lock(&(*table)->mtx_table);
// destroy items in tables
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment