- fixed memleak when deleting a connection
authorMartin Willi <martin@strongswan.org>
Mon, 29 May 2006 11:29:23 +0000 (11:29 -0000)
committerMartin Willi <martin@strongswan.org>
Mon, 29 May 2006 11:29:23 +0000 (11:29 -0000)
src/charon/threads/stroke_interface.c

index 9c41701..e31be8a 100755 (executable)
@@ -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);
        }
 }