aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/sa/states/ike_sa_init_responded.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2005-12-02 17:24:09 +0000
committerMartin Willi <martin@strongswan.org>2005-12-02 17:24:09 +0000
commitcaa6b542c0c55b97bd531099bf01b854da10c3c4 (patch)
treef8ba99036645cafbdd4c0d78e7685aa0d91528cb /Source/charon/sa/states/ike_sa_init_responded.c
parent7ef7c3835accd5334b39fca74bbf82f345830986 (diff)
downloadstrongswan-caa6b542c0c55b97bd531099bf01b854da10c3c4.tar.bz2
strongswan-caa6b542c0c55b97bd531099bf01b854da10c3c4.tar.xz
- fixed id bugs
Diffstat (limited to 'Source/charon/sa/states/ike_sa_init_responded.c')
-rw-r--r--Source/charon/sa/states/ike_sa_init_responded.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/charon/sa/states/ike_sa_init_responded.c b/Source/charon/sa/states/ike_sa_init_responded.c
index a07dc5ecc..0399bc9a8 100644
--- a/Source/charon/sa/states/ike_sa_init_responded.c
+++ b/Source/charon/sa/states/ike_sa_init_responded.c
@@ -251,6 +251,10 @@ static status_t build_idr_payload(private_ike_sa_init_responded_t *this, id_payl
init_config = this->ike_sa->get_init_config(this->ike_sa);
status = charon->configuration_manager->get_sa_config_for_init_config_and_id(charon->configuration_manager,init_config, other_id,my_id, &(this->sa_config));
other_id->destroy(other_id);
+ if (my_id)
+ {
+ my_id->destroy(my_id);
+ }
if (status != SUCCESS)
{
this->logger->log(this->logger, ERROR, "Could not find config for %s", other_id->get_string(other_id));
@@ -262,10 +266,7 @@ static status_t build_idr_payload(private_ike_sa_init_responded_t *this, id_payl
}
/* get my id, if not requested */
- if (!my_id)
- {
- my_id = this->sa_config->get_my_id(this->sa_config);
- }
+ my_id = this->sa_config->get_my_id(this->sa_config);
/* set sa_config in ike_sa for other states */
this->ike_sa->set_sa_config(this->ike_sa, this->sa_config);
@@ -274,7 +275,7 @@ static status_t build_idr_payload(private_ike_sa_init_responded_t *this, id_payl
idr_response = id_payload_create_from_identification(FALSE, my_id);
response->add_payload(response, (payload_t*)idr_response);
- my_id->destroy(my_id);
+
return SUCCESS;
}