Skip to content
Snippets Groups Projects
Commit 60083abf authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Clear pointers after free as a precaution.

parent b536dd8d
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@ static void tls_prng_deinit(void *ptr)
static void tls_prng_deinit_main()
{
tls_prng_deinit(pthread_getspecific(tls_prng_key));
(void)pthread_setspecific(tls_prng_key, NULL);
}
static void tls_prng_init()
......
......@@ -463,14 +463,8 @@ int slab_cache_init(slab_cache_t* cache, size_t bufsize)
return -1;
}
cache->empty = 0;
memset(cache, 0, sizeof(slab_cache_t));
cache->bufsize = bufsize;
cache->slabs_free = cache->slabs_full = 0;
cache->color = 0;
/* Initialize stats */
cache->stat_allocs = cache->stat_frees = 0;
dbg_mem("%s: created cache of size %zu\n",
__func__, bufsize);
......
......@@ -336,7 +336,8 @@ void knot_zone_tree_free(knot_zone_tree_t **tree)
if (tree == NULL || *tree == NULL) {
return;
}
hattrie_free((*tree));
hattrie_free(*tree);
*tree = NULL;
}
/*----------------------------------------------------------------------------*/
......
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