do not destroy whack_attr if it hasn't been initialized
This commit is contained in:
@@ -216,12 +216,17 @@ METHOD(whack_attribute_t, create_lease_enumerator, enumerator_t*,
|
|||||||
*/
|
*/
|
||||||
void whack_attribute_finalize()
|
void whack_attribute_finalize()
|
||||||
{
|
{
|
||||||
private_whack_attribute_t *this = (private_whack_attribute_t*)whack_attr;
|
private_whack_attribute_t *this;
|
||||||
hydra->attributes->remove_provider(hydra->attributes,
|
|
||||||
|
if (whack_attr)
|
||||||
|
{
|
||||||
|
this = (private_whack_attribute_t*)whack_attr;
|
||||||
|
hydra->attributes->remove_provider(hydra->attributes,
|
||||||
&this->public.provider);
|
&this->public.provider);
|
||||||
this->lock->destroy(this->lock);
|
this->lock->destroy(this->lock);
|
||||||
this->pools->destroy_offset(this->pools, offsetof(mem_pool_t, destroy));
|
this->pools->destroy_offset(this->pools, offsetof(mem_pool_t, destroy));
|
||||||
free(this);
|
free(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user