]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ike-sa-manager: Make sure rng is defined before destroying it in flush()
authorTobias Brunner <tobias@strongswan.org>
Thu, 26 May 2016 14:35:18 +0000 (16:35 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 17 Jun 2016 16:48:04 +0000 (18:48 +0200)
This allows calling flush() multiple times.

src/libcharon/sa/ike_sa_manager.c

index 9b9ad93a295302d07531284844b89c70123c2d62..63c9fdfa8e32936c9c86b24ccc206b1e984f0300 100644 (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;