aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/charon/config/policies/policy.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/charon/config/policies/policy.c b/src/charon/config/policies/policy.c
index f30d59670..4e238a32e 100644
--- a/src/charon/config/policies/policy.c
+++ b/src/charon/config/policies/policy.c
@@ -340,9 +340,15 @@ static policy_t *clone(private_policy_t *this)
traffic_selector_t *ts;
/* clone the certification authorities */
- clone->my_ca = this->my_ca->clone(this->my_ca);
- clone->other_ca = this->other_ca->clone(this->other_ca);
-
+ if (this->my_ca)
+ {
+ clone->my_ca = this->my_ca->clone(this->my_ca);
+ }
+ if (this->other_ca)
+ {
+ clone->other_ca = this->other_ca->clone(this->other_ca);
+ }
+
/* clone all proposals */
iterator = this->proposals->create_iterator(this->proposals, TRUE);
while (iterator->has_next(iterator))
@@ -407,8 +413,14 @@ static status_t destroy(private_policy_t *this)
this->other_ts->destroy(this->other_ts);
/* delete certification authorities */
- this->my_ca->destroy(this->my_ca);
- this->other_ca->destroy(this->other_ca);
+ if (this->my_ca)
+ {
+ this->my_ca->destroy(this->my_ca);
+ }
+ if (this->other_ca)
+ {
+ this->other_ca->destroy(this->other_ca);
+ }
/* delete ids */
this->my_id->destroy(this->my_id);