]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
fixed a potential memory leak when reusing mobike task
authorMartin Willi <martin@strongswan.org>
Fri, 19 Dec 2008 14:34:40 +0000 (14:34 -0000)
committerMartin Willi <martin@strongswan.org>
Fri, 19 Dec 2008 14:34:40 +0000 (14:34 -0000)
src/charon/sa/tasks/ike_mobike.c

index fc7df498d91e6359e44e1f75d9fe27ee582a7486..b2ef2731fd11a392ff9f7465c8922d58b3342702 100644 (file)
@@ -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;