From: Daniel Stenberg Date: Thu, 20 Apr 2017 13:46:03 +0000 (+0200) Subject: openssl: fix memory leak in servercert X-Git-Tag: curl-7_54_1~249 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da2af5c04dee9d0e16c02b468494f386ac69e837;p=curl openssl: fix memory leak in servercert ... when failing to get the server certificate. --- diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 58a014a4d..52ebe671a 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;