Commit 2f04e542 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

mod_ssl: fix small memory leak in ssl_init_server_certs when ECDH is used.

SSL_CTX_set_tmp_ecdh increases reference count, so we have to call
EC_KEY_free, otherwise eckey will not be freed.

Backports: r1666363
Author: jkaluza
Reviewed by: rjung, ylavic, wrowe



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1682074 13f79535-47bb-0310-9956-ffa450edef68
parent 0ed06757
Loading
Loading
Loading
Loading
+0 −7
Changes for STATUS: 0 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -105,13 +105,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) mod_ssl: fix small memory leak in ssl_init_server_certs when ECDH is used.
     SSL_CTX_set_tmp_ecdh increases reference count, so we have to call
     EC_KEY_free, otherwise eckey will not be freed.
     trunk patch: http://svn.apache.org/r1666363
     2.4.x patch: http://people.apache.org/~rjung/patches/httpd-2.4.x-free-eckey.patch
     +1: rjung, ylavic, wrowe


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+2 −1
Changes for modules/ssl/ssl_engine_init.c: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -960,7 +960,7 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
#ifdef HAVE_ECC
    EC_GROUP *ecparams;
    int nid;
    EC_KEY *eckey;
    EC_KEY *eckey = NULL;
#endif
#ifndef HAVE_SSL_CONF_CMD
    SSL *ssl;
@@ -1133,6 +1133,7 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
                             EC_KEY_new_by_curve_name(NID_X9_62_prime256v1));
#endif
    }
    EC_KEY_free(eckey);
#endif

    return APR_SUCCESS;