From 5455cf230ffc8a3a4244b8b6588b298bf7640dce Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Fri, 9 Mar 2007 14:59:28 +0000 Subject: [PATCH] fixed a certinfo_t memory leak in verify() --- src/charon/config/credentials/local_credential_store.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/charon/config/credentials/local_credential_store.c b/src/charon/config/credentials/local_credential_store.c index 25ba970e2..9dcd28be3 100644 --- a/src/charon/config/credentials/local_credential_store.c +++ b/src/charon/config/credentials/local_credential_store.c @@ -621,7 +621,7 @@ static bool verify(private_local_credential_store_t *this, x509_t *cert, bool *f } /* first check certificate revocation using ocsp */ - status = issuer->verify_by_ocsp(issuer, cert, certinfo, &this->public); + status = issuer->verify_by_ocsp(issuer, cert, certinfo, &this->public.credential_store); /* if ocsp service is not available then fall back to crl */ if ((status == CERT_UNDEFINED) || (status == CERT_UNKNOWN && this->strict)) @@ -642,6 +642,7 @@ static bool verify(private_local_credential_store_t *this, x509_t *cert, bool *f if (this->strict && nextUpdate < time(NULL)) { DBG2(DBG_CFG, "certificate is good but status is stale"); + certinfo->destroy(certinfo); return FALSE; } DBG2(DBG_CFG, "certificate is good"); @@ -677,6 +678,7 @@ static bool verify(private_local_credential_store_t *this, x509_t *cert, bool *f certinfo->get_revocationTime(certinfo)); } } + certinfo->destroy(certinfo); return FALSE; } case CERT_UNKNOWN: @@ -690,6 +692,7 @@ static bool verify(private_local_credential_store_t *this, x509_t *cert, bool *f { cert_copy->set_status(cert_copy, CERT_UNTRUSTED); } + certinfo->destroy(certinfo); return FALSE; } break;