Correct check of traffic selectors before destruction
authorThomas Egerer <thomas.egerer@secunet.com>
Mon, 28 Jun 2010 20:18:25 +0000 (22:18 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 29 Jun 2010 07:22:50 +0000 (09:22 +0200)
src/libcharon/sa/tasks/child_create.c

index bea4f73..ed468ec 100644 (file)
@@ -1229,11 +1229,11 @@ static void migrate(private_child_create_t *this, ike_sa_t *ike_sa)
 {
        chunk_free(&this->my_nonce);
        chunk_free(&this->other_nonce);
-       if (this->tsi)
+       if (this->tsr)
        {
                this->tsr->destroy_offset(this->tsr, offsetof(traffic_selector_t, destroy));
        }
-       if (this->tsr)
+       if (this->tsi)
        {
                this->tsi->destroy_offset(this->tsi, offsetof(traffic_selector_t, destroy));
        }