ike-sa-manager: Make sure rng is defined before destroying it in flush()

This allows calling flush() multiple times.
This commit is contained in:
Tobias Brunner
2016-06-17 18:48:04 +02:00
parent 851ee4eeb7
commit b7fac1d96e
+1 -1
View File
@@ -2188,7 +2188,7 @@ METHOD(ike_sa_manager_t, flush, void,
unlock_all_segments(this);
this->spi_lock->write_lock(this->spi_lock);
this->rng->destroy(this->rng);
DESTROY_IF(this->rng);
this->rng = NULL;
this->spi_cb.cb = NULL;
this->spi_cb.data = NULL;