diff options
author | Martin Willi <martin@strongswan.org> | 2006-10-24 08:46:17 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-10-24 08:46:17 +0000 |
commit | 55bbff11ec96f74b27afc36dd8ca3e34ff425b40 (patch) | |
tree | 9d0ff1aad70e01718405a8da314d22a86b072947 /src/charon/encoding/payloads/cp_payload.c | |
parent | 5c4cc9a4e328d86867959dec0e082f7e4f098a6e (diff) | |
download | strongswan-55bbff11ec96f74b27afc36dd8ca3e34ff425b40.tar.bz2 strongswan-55bbff11ec96f74b27afc36dd8ca3e34ff425b40.tar.xz |
linked list cleanups
added list methods invoke(), destroy_offset(), destroy_function()
simplified list destruction when destroying its items
Diffstat (limited to 'src/charon/encoding/payloads/cp_payload.c')
-rw-r--r-- | src/charon/encoding/payloads/cp_payload.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/charon/encoding/payloads/cp_payload.c b/src/charon/encoding/payloads/cp_payload.c index f1297e444..580a0c64a 100644 --- a/src/charon/encoding/payloads/cp_payload.c +++ b/src/charon/encoding/payloads/cp_payload.c @@ -240,20 +240,11 @@ static config_type_t get_config_type (private_cp_payload_t *this) /** * Implementation of payload_t.destroy and cp_payload_t.destroy. */ -static status_t destroy(private_cp_payload_t *this) +static void destroy(private_cp_payload_t *this) { - /* all attributes are getting destroyed */ - while (this->attributes->get_count(this->attributes) > 0) - { - configuration_attribute_t *current_attribute; - this->attributes->remove_last(this->attributes,(void **)¤t_attribute); - current_attribute->destroy(current_attribute); - } - this->attributes->destroy(this->attributes); - + this->attributes->destroy_offset(this->attributes, + offsetof(configuration_attribute_t, destroy)); free(this); - - return SUCCESS; } /* |