- fixed memleaks

This commit is contained in:
Martin Willi
2006-02-09 11:56:24 +00:00
parent 93df94acad
commit dfa6e086a0
8 changed files with 87 additions and 17 deletions
+2 -1
View File
@@ -473,9 +473,10 @@ static void get_protocols(private_child_proposal_t *this, protocol_id_t ids[2])
if (i>1)
{
/* should not happen, but who knows */
return;
break;
}
}
iterator->destroy(iterator);
}
/**
+3 -6
View File
@@ -287,25 +287,22 @@ static status_t destroy(private_sa_config_t *this)
/* delete proposals */
while(this->proposals->get_count(this->proposals) > 0)
while(this->proposals->remove_last(this->proposals, (void**)&proposal) == SUCCESS)
{
this->proposals->remove_last(this->proposals, (void**)&proposal);
proposal->destroy(proposal);
}
this->proposals->destroy(this->proposals);
/* delete traffic selectors */
while(this->ts_initiator->get_count(this->ts_initiator) > 0)
while(this->ts_initiator->remove_last(this->ts_initiator, (void**)&traffic_selector) == SUCCESS)
{
this->ts_initiator->remove_last(this->ts_initiator, (void**)&traffic_selector);
traffic_selector->destroy(traffic_selector);
}
this->ts_initiator->destroy(this->ts_initiator);
/* delete traffic selectors */
while(this->ts_responder->get_count(this->ts_responder) > 0)
while(this->ts_responder->remove_last(this->ts_responder, (void**)&traffic_selector) == SUCCESS)
{
this->ts_responder->remove_last(this->ts_responder, (void**)&traffic_selector);
traffic_selector->destroy(traffic_selector);
}
this->ts_responder->destroy(this->ts_responder);