From 027f05e34946602f6c07834701026f6f5632ed10 Mon Sep 17 00:00:00 2001 From: Radim Smat Date: Thu, 4 Mar 2021 13:40:45 +0100 Subject: [PATCH] Fixed CID 583215. --- src/ocsp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ocsp.c b/src/ocsp.c index efb86f37c..427c1a34c 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -608,8 +608,10 @@ WOLFSSL_OCSP_CERTID* wolfSSL_OCSP_cert_to_id( XMEMCPY(derCert->buffer, issuer->derCert->buffer, issuer->derCert->length); ret = AddCA(cm, &derCert, WOLFSSL_USER_CA, 1); - if (ret != WOLFSSL_SUCCESS) + if (ret != WOLFSSL_SUCCESS) { + wolfSSL_CertManagerFree(cm); return NULL; + } } certId = (WOLFSSL_OCSP_CERTID*)XMALLOC(sizeof(WOLFSSL_OCSP_CERTID), NULL,