From: Thomas Egerer Date: Tue, 29 Jun 2010 06:53:05 +0000 (+0200) Subject: Migrate queued_tasks tasks, to avoid dangling pointers X-Git-Tag: 4.4.1~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f1eb89517d2cc85958bce20be8d95e92087bd64;p=thirdparty%2Fstrongswan.git Migrate queued_tasks tasks, to avoid dangling pointers --- diff --git a/src/libcharon/sa/task_manager.c b/src/libcharon/sa/task_manager.c index 8857186f92..568f31a3aa 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)