From: Tobias Brunner Date: Thu, 26 May 2016 14:35:18 +0000 (+0200) Subject: ike-sa-manager: Make sure rng is defined before destroying it in flush() X-Git-Tag: 5.5.0dr1~4^2~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b7fac1d96ec266a6ebc99b8d4fb4cf9ee5b2e9e5;p=thirdparty%2Fstrongswan.git ike-sa-manager: Make sure rng is defined before destroying it in flush() This allows calling flush() multiple times. --- diff --git a/src/libcharon/sa/ike_sa_manager.c b/src/libcharon/sa/ike_sa_manager.c index 9b9ad93a29..63c9fdfa8e 100644 --- a/src/libcharon/sa/ike_sa_manager.c +++ b/src/libcharon/sa/ike_sa_manager.c @@ -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;