From: Martin Willi Date: Fri, 19 Dec 2008 14:34:40 +0000 (-0000) Subject: fixed a potential memory leak when reusing mobike task X-Git-Tag: 4.2.10~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12d4186f5c6de5771d8d5ae544dcebf2727a4e5a;p=thirdparty%2Fstrongswan.git fixed a potential memory leak when reusing mobike task --- diff --git a/src/charon/sa/tasks/ike_mobike.c b/src/charon/sa/tasks/ike_mobike.c index fc7df498d9..b2ef2731fd 100644 --- a/src/charon/sa/tasks/ike_mobike.c +++ b/src/charon/sa/tasks/ike_mobike.c @@ -521,6 +521,10 @@ static status_t process_i(private_ike_mobike_t *this, message_t *message) /* start the update with the same task */ this->check = FALSE; this->address = FALSE; + if (this->natd) + { + this->natd->task.destroy(&this->natd->task); + } this->natd = ike_natd_create(this->ike_sa, this->initiator); this->ike_sa->set_pending_updates(this->ike_sa, 1); return NEED_MORE;