Avoid a deadlock when installing a trap policy failed

This commit is contained in:
Tobias Brunner 2013-01-23 15:51:47 +01:00
parent 8d631ebabd
commit 4eb09d14e2

View File

@ -170,8 +170,8 @@ METHOD(trap_manager_t, install, u_int32_t,
if (status != SUCCESS)
{
DBG1(DBG_CFG, "installing trap failed");
child_sa->destroy(child_sa);
reqid = 0;
/* hold off destroying the CHILD_SA until we released the lock */
}
else
{
@ -184,6 +184,10 @@ METHOD(trap_manager_t, install, u_int32_t,
}
this->lock->unlock(this->lock);
if (status != SUCCESS)
{
child_sa->destroy(child_sa);
}
if (found)
{
destroy_entry(found);