aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-05-22 19:51:44 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-05-22 19:51:44 +0000
commita9d49769ff1a27ab5e347d0d87100e6ed0d6796b (patch)
tree49c9aab922bc98f1ee5e9209b29b53bba6edee58 /lib
parentd7616d8a0a804530e5bb1bb04b24de46d9258e3e (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/ssluse.c3
1 files changed, 2 insertions, 1 deletions
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 */