ha: Delete cache entry inside the locked mutex
authorThomas Egerer <thomas.egerer@secunet.com>
Mon, 21 Mar 2016 13:46:11 +0000 (14:46 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 23 Mar 2016 09:34:24 +0000 (10:34 +0100)
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
src/libcharon/plugins/ha/ha_cache.c

index 0650f7f..832dcf4 100644 (file)
@@ -186,11 +186,13 @@ METHOD(ha_cache_t, delete_, void,
 {
        entry_t *entry;
 
+       this->mutex->lock(this->mutex);
        entry = this->cache->remove(this->cache, ike_sa);
        if (entry)
        {
                entry_destroy(entry);
        }
+       this->mutex->unlock(this->mutex);
 }
 
 /**