Fix memory leak.
[openssl.git] / ssl / ssl_lib.c
index 2e85a560fe0013378df6df90b82219369cb6dd02..17fc536636715b85d0e4d879211786ac416f577a 100644 (file)
@@ -432,7 +432,7 @@ int SSL_set_generate_session_id(SSL *ssl, GEN_SESSION_CB cb)
        }
 
 int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
-                                   size_t id_len)
+                               unsigned int id_len)
        {
        /* A quick examination of SSL_SESSION_hash and SSL_SESSION_cmp shows how
         * we can "construct" a session to give us the desired check - ie. to
@@ -547,6 +547,8 @@ void SSL_free(SSL *s)
 
        if (s->ctx) SSL_CTX_free(s->ctx);
 #ifndef OPENSSL_NO_TLSEXT
+       if (s->tlsext_hostname)
+               OPENSSL_free(s->tlsext_hostname);
        if (s->initial_ctx) SSL_CTX_free(s->initial_ctx);
 #ifndef OPENSSL_NO_EC
        if (s->tlsext_ecpointformatlist) OPENSSL_free(s->tlsext_ecpointformatlist);