From a9d49769ff1a27ab5e347d0d87100e6ed0d6796b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 22 May 2007 19:51:44 +0000 Subject: Andre Guibert de Bruet fixed a memory leak in the function that verifies the peer's name in the SSL certificate when built for OpenSSL. The leak happens for libcurls with CURL_DOES_CONVERSIONS enabled that fail to convert the CN name from UTF8. --- lib/ssluse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/ssluse.c') diff --git a/lib/ssluse.c b/lib/ssluse.c index 5c2999dfa..76c3bd846 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -1123,7 +1123,8 @@ static CURLcode verifyhost(struct connectdata *conn, rc = Curl_convert_from_utf8(data, peer_CN, strlen(peer_CN)); /* Curl_convert_from_utf8 calls failf if unsuccessful */ if (rc != CURLE_OK) { - return(rc); + OPENSSL_free(peer_CN); + return rc; } } #endif /* CURL_DOES_CONVERSIONS */ -- cgit v1.2.3