From: Thomas Egerer Date: Wed, 20 Mar 2024 10:11:17 +0000 (+0000) Subject: ike-sa-manager: Unlock mutex if allocating SPI fails to avoid lock contention X-Git-Tag: android-2.5.2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f3c8e02c694c510776753ef1dc2055ee44e31185;p=thirdparty%2Fstrongswan.git ike-sa-manager: Unlock mutex if allocating SPI fails to avoid lock contention Fixes: 5d91d8c46937 ("Check rng return value when generating SPIs in ike_sa_manager_t") Signed-off-by: Thomas Egerer --- diff --git a/src/libcharon/sa/ike_sa_manager.c b/src/libcharon/sa/ike_sa_manager.c index 7763ae844e..d59fdb7f52 100644 --- a/src/libcharon/sa/ike_sa_manager.c +++ b/src/libcharon/sa/ike_sa_manager.c @@ -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; }