fixed double free bug

This commit is contained in:
Martin Willi
2007-03-05 22:02:14 +00:00
parent 0b0eb65573
commit 02b3101b67
10 changed files with 96 additions and 24 deletions
+10 -3
View File
@@ -193,7 +193,9 @@ static status_t select_and_install(private_child_create_t *this)
my_vip = this->ike_sa->get_virtual_ip(this->ike_sa, TRUE);
other_vip = this->ike_sa->get_virtual_ip(this->ike_sa, FALSE);
DBG1(DBG_IKE, "received %d proposals, selecting:", this->proposals->get_count(this->proposals));
this->proposal = this->policy->select_proposal(this->policy, this->proposals);
DBG1(DBG_IKE, "proposal is %p", this->proposal);
if (this->initiator && my_vip)
{ /* if we have a virtual IP, shorten our TS to the minimum */
@@ -230,14 +232,19 @@ static status_t select_and_install(private_child_create_t *this)
this->tsi = other_ts;
}
if (this->proposal == NULL ||
this->tsi->get_count(this->tsi) == 0 ||
this->tsr->get_count(this->tsr) == 0)
if (this->proposal == NULL)
{
SIG(CHILD_UP_FAILED, "no acceptable proposal found");
return FAILED;
}
if (this->tsi->get_count(this->tsi) == 0 ||
this->tsr->get_count(this->tsr) == 0)
{
SIG(CHILD_UP_FAILED, "no acceptable traffic selectors found");
return FAILED;
}
if (!this->initiator)
{
/* check if requested mode is acceptable, downgrade if required */