]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
regression from nolock mode
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 16 Dec 2016 00:59:53 +0000 (18:59 -0600)
committerMike Jerris <mike@jerris.com>
Wed, 25 Jan 2017 20:59:36 +0000 (14:59 -0600)
libs/libks/src/ks_hash.c
libs/libks/test/testhash.c

index db26209419d6518e4700eac2fa5ddf4033809b73..c65e2b4d28e2c5ece2a4e52a50ac9ef2d917c73a 100644 (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;
index 220a6c6959ed6977693940fc4ebe6cd69449d313..7b7bdc24e2c16503d69743ee8dca90d69c884c9a 100644 (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));