From 139ce7871f1a1117ea1c71ec170b7b35698cea48 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Mon, 29 May 2006 11:29:23 +0000 Subject: [PATCH] - fixed memleak when deleting a connection --- src/charon/threads/stroke_interface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/charon/threads/stroke_interface.c b/src/charon/threads/stroke_interface.c index 9c41701d7..e31be8a1c 100755 --- a/src/charon/threads/stroke_interface.c +++ b/src/charon/threads/stroke_interface.c @@ -362,6 +362,7 @@ static void stroke_initiate(private_stroke_t *this, stroke_msg_t *msg) initiate_ike_sa_job_t *job; connection_t *connection; linked_list_t *ike_sas; + ike_sa_id_t *ike_sa_id; pop_string(msg, &(msg->initiate.name)); this->logger->log(this->logger, CONTROL, "received stroke: initiate \"%s\"", msg->initiate.name); @@ -383,9 +384,12 @@ static void stroke_initiate(private_stroke_t *this, stroke_msg_t *msg) } else { - this->stroke_logger->log(this->stroke_logger, CONTROL, "connection \"%s\" already up", msg->initiate.name); } + while (ike_sas->remove_last(ike_sas, (void**)&ike_sa_id) == SUCCESS) + { + ike_sa_id->destroy(ike_sa_id); + } ike_sas->destroy(ike_sas); } }