From 0964272dc62cbe7bf097420ba3bf0079846730bc Mon Sep 17 00:00:00 2001 From: Stanislav Klima Date: Wed, 5 Feb 2020 18:28:50 +0100 Subject: [PATCH] Resource leak fix. --- src/ssl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ssl.c b/src/ssl.c index a67bbeafb..21dab1708 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -43820,8 +43820,10 @@ int wolfSSL_X509_check_host(X509 *x, const char *chk, size_t chklen, InitDecodedCert(&dCert, x->derCert->buffer, x->derCert->length, NULL); ret = ParseCertRelative(&dCert, CERT_TYPE, 0, NULL); - if (ret != 0) + if (ret != 0) { + FreeDecodedCert(&dCert); return WOLFSSL_FAILURE; + } ret = CheckHostName(&dCert, (char *)chk, chklen); FreeDecodedCert(&dCert);