aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/crypto/crl.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2006-10-24 08:46:17 +0000
committerMartin Willi <martin@strongswan.org>2006-10-24 08:46:17 +0000
commit55bbff11ec96f74b27afc36dd8ca3e34ff425b40 (patch)
tree9d0ff1aad70e01718405a8da314d22a86b072947 /src/libstrongswan/crypto/crl.c
parent5c4cc9a4e328d86867959dec0e082f7e4f098a6e (diff)
downloadstrongswan-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/libstrongswan/crypto/crl.c')
-rwxr-xr-xsrc/libstrongswan/crypto/crl.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/libstrongswan/crypto/crl.c b/src/libstrongswan/crypto/crl.c
index b2c24b80b..f1c21c74b 100755
--- a/src/libstrongswan/crypto/crl.c
+++ b/src/libstrongswan/crypto/crl.c
@@ -411,24 +411,10 @@ static void get_status(const private_crl_t *this, certinfo_t *certinfo)
*/
static void destroy(private_crl_t *this)
{
- revokedCert_t *revokedCert;
- identification_t *id;
-
- while (this->revokedCertificates->remove_last(this->revokedCertificates, (void**)&revokedCert) == SUCCESS)
- {
- free(revokedCert);
- }
- this->revokedCertificates->destroy(this->revokedCertificates);
-
- while (this->crlDistributionPoints->remove_last(this->crlDistributionPoints, (void**)&id) == SUCCESS)
- {
- id->destroy(id);
- }
- this->crlDistributionPoints->destroy(this->crlDistributionPoints);
-
- if (this->issuer)
- this->issuer->destroy(this->issuer);
-
+ this->revokedCertificates->destroy_function(this->revokedCertificates, free);
+ this->crlDistributionPoints->destroy_offset(this->crlDistributionPoints,
+ offsetof(identification_t, destroy));
+ DESTROY_IF(this->issuer);
free(this->certificateList.ptr);
free(this);
}