aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/encoding/payloads/transform_substructure.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/encoding/payloads/transform_substructure.c')
-rw-r--r--src/charon/encoding/payloads/transform_substructure.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/charon/encoding/payloads/transform_substructure.c b/src/charon/encoding/payloads/transform_substructure.c
index 59e335a74..944336cc7 100644
--- a/src/charon/encoding/payloads/transform_substructure.c
+++ b/src/charon/encoding/payloads/transform_substructure.c
@@ -354,15 +354,8 @@ static status_t get_key_length(private_transform_substructure_t *this, u_int16_t
*/
static void destroy(private_transform_substructure_t *this)
{
- /* all proposals are getting destroyed */
- while (this->attributes->get_count(this->attributes) > 0)
- {
- transform_attribute_t *current_attribute;
- this->attributes->remove_last(this->attributes,(void **)&current_attribute);
- current_attribute->destroy(current_attribute);
- }
- this->attributes->destroy(this->attributes);
-
+ this->attributes->destroy_offset(this->attributes,
+ offsetof(transform_attribute_t, destroy));
free(this);
}