]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ike-sa-manager: Unlock mutex if allocating SPI fails to avoid lock contention
authorThomas Egerer <thomas.egerer@secunet.com>
Wed, 20 Mar 2024 10:11:17 +0000 (10:11 +0000)
committerTobias Brunner <tobias@strongswan.org>
Wed, 20 Mar 2024 12:18:57 +0000 (13:18 +0100)
Fixes: 5d91d8c46937 ("Check rng return value when generating SPIs in ike_sa_manager_t")
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
src/libcharon/sa/ike_sa_manager.c

index 7763ae844ebb56d398e40f97264acff0477de348..d59fdb7f527ded86d22fc58731e3fbc8cd43f16f 100644 (file)
@@ -1151,6 +1151,7 @@ static status_t check_and_put_init_hash(private_ike_sa_manager_t *this,
        spi = get_spi(this);
        if (!spi)
        {
+               mutex->unlock(mutex);
                return FAILED;
        }