diff --git a/CHANGES b/CHANGES index d208dce795..db36e11645 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0.44 + *) Fix memory leak in mod_ssl from internal SSL library allocations + within SSL_get_peer_certificate and X509_get_pubkey. + [Zvi Har'El + Madhusudan Mathihalli ]. + *) mod_ssl uses free() inappropriately in several places, to free memory which has been previously allocated inside OpenSSL. Such memory should be freed with OPENSSL_free(), not with free(). diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c index bf63baf4c1..b387ccc944 100644 --- a/modules/ssl/ssl_engine_init.c +++ b/modules/ssl/ssl_engine_init.c @@ -807,6 +807,7 @@ static int ssl_server_import_key(server_rec *s, ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, "Copying DSA parameters from private key to certificate"); ssl_log_ssl_error(APLOG_MARK, APLOG_ERR, s); + EVP_PKEY_free(pubkey); } }