diff options
Diffstat (limited to 'src/libcharon/sa/ike_sa.c')
-rw-r--r-- | src/libcharon/sa/ike_sa.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c index c55d2b68b..453a50c41 100644 --- a/src/libcharon/sa/ike_sa.c +++ b/src/libcharon/sa/ike_sa.c @@ -2080,19 +2080,14 @@ METHOD(ike_sa_t, destroy, void, { if (this->peer_cfg) { - enumerator_t *enumerator; - char *pool; - - enumerator = this->peer_cfg->create_pool_enumerator(this->peer_cfg); - while (enumerator->enumerate(enumerator, &pool)) - { - if (hydra->attributes->release_address(hydra->attributes, pool, - vip, get_other_eap_id(this))) - { - break; - } - } - enumerator->destroy(enumerator); + linked_list_t *pools; + identification_t *id; + + id = get_other_eap_id(this); + pools = linked_list_create_from_enumerator( + this->peer_cfg->create_pool_enumerator(this->peer_cfg)); + hydra->attributes->release_address(hydra->attributes, pools, vip, id); + pools->destroy(pools); } vip->destroy(vip); } |