diff options
author | Martin Willi <martin@strongswan.org> | 2006-04-10 08:07:38 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-04-10 08:07:38 +0000 |
commit | 5113680f95e522c677cdd37072cfffbdca06831e (patch) | |
tree | 973ac57accbc66b042e5307942c6cbbbf4f19579 /Source/lib/crypto/certificate.c | |
parent | 6862128151fb78f63685a8da5575783c426d64a7 (diff) | |
download | strongswan-5113680f95e522c677cdd37072cfffbdca06831e.tar.bz2 strongswan-5113680f95e522c677cdd37072cfffbdca06831e.tar.xz |
- split up in libstrong, charon, stroke, testing done
- new leak detective with malloc hook in library
- useable, but needs improvements
- logger_manager has now a single instance per library
- allows use of loggers from any linking prog
- a LOT of other things
Diffstat (limited to 'Source/lib/crypto/certificate.c')
-rwxr-xr-x | Source/lib/crypto/certificate.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/lib/crypto/certificate.c b/Source/lib/crypto/certificate.c index 2c8f30bf3..34c82e853 100755 --- a/Source/lib/crypto/certificate.c +++ b/Source/lib/crypto/certificate.c @@ -27,7 +27,6 @@ #include "certificate.h" #include <daemon.h> -#include <utils/allocator.h> #include <asn1/der_decoder.h> @@ -151,10 +150,10 @@ static rsa_public_key_t *get_public_key(private_certificate_t *this) static void destroy(private_certificate_t *this) { this->public_key->destroy(this->public_key); - allocator_free(this->pubkey.ptr); - allocator_free(this->signature.ptr); - allocator_free(this->tbs_cert.ptr); - allocator_free(this); + free(this->pubkey.ptr); + free(this->signature.ptr); + free(this->tbs_cert.ptr); + free(this); } /* @@ -162,7 +161,7 @@ static void destroy(private_certificate_t *this) */ certificate_t *certificate_create_from_chunk(chunk_t chunk) { - private_certificate_t *this = allocator_alloc_thing(private_certificate_t); + private_certificate_t *this = malloc_thing(private_certificate_t); der_decoder_t *dd; /* public functions */ @@ -178,7 +177,7 @@ certificate_t *certificate_create_from_chunk(chunk_t chunk) if (dd->decode(dd, chunk, this) != SUCCESS) { - allocator_free(this); + free(this); dd->destroy(dd); return NULL; } @@ -187,8 +186,8 @@ certificate_t *certificate_create_from_chunk(chunk_t chunk) this->public_key = rsa_public_key_create_from_chunk(this->pubkey); if (this->public_key == NULL) { - allocator_free(this->pubkey.ptr); - allocator_free(this); + free(this->pubkey.ptr); + free(this); return NULL; } @@ -220,8 +219,10 @@ certificate_t *certificate_create_from_file(char *filename) if (fread(buffer, stb.st_size, 1, file) == -1) { + fclose(file); return NULL; } + fclose(file); chunk.ptr = buffer; chunk.len = stb.st_size; |