diff options
Diffstat (limited to 'src/libcharon/sa/trap_manager.c')
-rw-r--r-- | src/libcharon/sa/trap_manager.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcharon/sa/trap_manager.c b/src/libcharon/sa/trap_manager.c index 69b23e1df..6c0ae19c7 100644 --- a/src/libcharon/sa/trap_manager.c +++ b/src/libcharon/sa/trap_manager.c @@ -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); |