From da2af5c04dee9d0e16c02b468494f386ac69e837 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 20 Apr 2017 15:46:03 +0200 Subject: [PATCH] openssl: fix memory leak in servercert ... when failing to get the server certificate. --- lib/vtls/openssl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 58a014a4d7..52ebe671af 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2819,6 +2819,7 @@ static CURLcode servercert(struct connectdata *conn, connssl->server_cert = SSL_get_peer_certificate(connssl->handle); if(!connssl->server_cert) { + BIO_free(mem); if(!strict) return CURLE_OK;