regression from nolock mode

This commit is contained in:
Anthony Minessale 2016-12-15 18:59:53 -06:00 committed by Mike Jerris
parent aed03077ef
commit 68e5321da0
2 changed files with 4 additions and 2 deletions

View File

@ -558,7 +558,9 @@ ks_hash_destroy(ks_hash_t **h)
ks_pool_safe_free(pool, (*h)->table);
ks_hash_write_unlock(*h);
if ((*h)->rwl) ks_pool_free(pool, (*h)->rwl);
ks_pool_free(pool, (*h)->mutex);
if ((*h)->mutex) {
ks_pool_free(pool, (*h)->mutex);
}
ks_pool_free(pool, *h);
pool = NULL;
*h = NULL;

View File

@ -132,7 +132,7 @@ int test3(void)
char *A, *B, *C;
ks_pool_open(&pool);
ks_hash_create(&hash, KS_HASH_MODE_ARBITRARY, KS_HASH_FLAG_NONE, pool);
ks_hash_create(&hash, KS_HASH_MODE_ARBITRARY, KS_HASH_FLAG_NOLOCK, pool);
ks_hash_set_keysize(hash, TEST3_SIZE);
randombytes_buf(data, sizeof(data));