From 7f1eb89517d2cc85958bce20be8d95e92087bd64 Mon Sep 17 00:00:00 2001 From: Thomas Egerer Date: Tue, 29 Jun 2010 08:53:05 +0200 Subject: [PATCH] Migrate queued_tasks tasks, to avoid dangling pointers --- src/libcharon/sa/task_manager.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libcharon/sa/task_manager.c b/src/libcharon/sa/task_manager.c index 8857186f9..568f31a3a 100644 --- a/src/libcharon/sa/task_manager.c +++ b/src/libcharon/sa/task_manager.c @@ -1003,6 +1003,13 @@ METHOD(task_manager_t, reset, void, } this->initiating.type = EXCHANGE_TYPE_UNDEFINED; + /* reset queued tasks */ + while (this->queued_tasks->remove_last(this->queued_tasks, + (void**)&task) == SUCCESS) + { + task->migrate(task, this->ike_sa); + this->queued_tasks->insert_first(this->queued_tasks, task); + } /* reset active tasks */ while (this->active_tasks->remove_last(this->active_tasks, (void**)&task) == SUCCESS)