aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2006-10-30 09:53:54 +0000
committerMartin Willi <martin@strongswan.org>2006-10-30 09:53:54 +0000
commit5923be21b43b1c57ff9f390e4105748d9dd69ce8 (patch)
tree64888f52e61eb8fcfbf07472f78d1f29a93f677c
parent7b898a0d8abc182fddaa598b6aa8cfb4871195e8 (diff)
downloadstrongswan-5923be21b43b1c57ff9f390e4105748d9dd69ce8.tar.bz2
strongswan-5923be21b43b1c57ff9f390e4105748d9dd69ce8.tar.xz
fixed SIGSEGV when setup of an additional CHILD_SA fails
-rw-r--r--src/charon/sa/transactions/create_child_sa.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/charon/sa/transactions/create_child_sa.c b/src/charon/sa/transactions/create_child_sa.c
index dab6bf178..64984cbad 100644
--- a/src/charon/sa/transactions/create_child_sa.c
+++ b/src/charon/sa/transactions/create_child_sa.c
@@ -928,8 +928,14 @@ static void destroy(private_create_child_sa_t *this)
DESTROY_IF(this->proposal);
DESTROY_IF(this->child_sa);
DESTROY_IF(this->policy);
- this->tsi->destroy_offset(this->tsi, offsetof(traffic_selector_t, destroy));
- this->tsr->destroy_offset(this->tsr, offsetof(traffic_selector_t, destroy));
+ if (this->tsi)
+ {
+ this->tsi->destroy_offset(this->tsi, offsetof(traffic_selector_t, destroy));
+ }
+ if (this->tsr)
+ {
+ this->tsr->destroy_offset(this->tsr, offsetof(traffic_selector_t, destroy));
+ }
chunk_free(&this->nonce_i);
chunk_free(&this->nonce_r);
chunk_free(&this->nonce_s);