fixed cleanup of traffic selector lists
[strongswan.git] / src / charon / sa / tasks / child_create.c
index 382266f..6bf9e9d 100644 (file)
@@ -1126,11 +1126,11 @@ static void destroy(private_child_create_t *this)
 {
        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));
        }