aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-04-29 07:28:51 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-04-29 07:28:51 +0200
commit916fd45709218e5a9fc59aa6fe4a1456d921f6b7 (patch)
tree614e0e2fd1a33fcf77bc1a63ea875cd4ff196570 /src
parente20a4940139c672491705897c8af4dcefdbf859b (diff)
downloadstrongswan-916fd45709218e5a9fc59aa6fe4a1456d921f6b7.tar.bz2
strongswan-916fd45709218e5a9fc59aa6fe4a1456d921f6b7.tar.xz
do not destroy whack_attr if it hasn't been initialized
Diffstat (limited to 'src')
-rw-r--r--src/pluto/whack_attribute.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/pluto/whack_attribute.c b/src/pluto/whack_attribute.c
index 11692dc35..6a12f0c09 100644
--- a/src/pluto/whack_attribute.c
+++ b/src/pluto/whack_attribute.c
@@ -216,12 +216,17 @@ METHOD(whack_attribute_t, create_lease_enumerator, enumerator_t*,
*/
void whack_attribute_finalize()
{
- private_whack_attribute_t *this = (private_whack_attribute_t*)whack_attr;
- hydra->attributes->remove_provider(hydra->attributes,
+ private_whack_attribute_t *this;
+
+ if (whack_attr)
+ {
+ this = (private_whack_attribute_t*)whack_attr;
+ hydra->attributes->remove_provider(hydra->attributes,
&this->public.provider);
- this->lock->destroy(this->lock);
- this->pools->destroy_offset(this->pools, offsetof(mem_pool_t, destroy));
- free(this);
+ this->lock->destroy(this->lock);
+ this->pools->destroy_offset(this->pools, offsetof(mem_pool_t, destroy));
+ free(this);
+ }
}
/**